Commit e07230da authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: fix to check pinfile flag in f2fs_move_file_range()

ioctl(F2FS_IOC_MOVE_RANGE) can truncate or punch hole on pinned file,
fix to disallow it.

Fixes: 5fed0be8 ("f2fs: do not allow partial truncation on pinned file")
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 278a6253
......@@ -2860,7 +2860,8 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
goto out;
}
if (f2fs_compressed_file(src) || f2fs_compressed_file(dst)) {
if (f2fs_compressed_file(src) || f2fs_compressed_file(dst) ||
f2fs_is_pinned_file(src) || f2fs_is_pinned_file(dst)) {
ret = -EOPNOTSUPP;
goto out_unlock;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment