Skip to content

Commit e07230d

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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: 5fed0be ("f2fs: do not allow partial truncation on pinned file") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 278a625 commit e07230d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/f2fs/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,8 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
28602860
goto out;
28612861
}
28622862

2863-
if (f2fs_compressed_file(src) || f2fs_compressed_file(dst)) {
2863+
if (f2fs_compressed_file(src) || f2fs_compressed_file(dst) ||
2864+
f2fs_is_pinned_file(src) || f2fs_is_pinned_file(dst)) {
28642865
ret = -EOPNOTSUPP;
28652866
goto out_unlock;
28662867
}

0 commit comments

Comments
 (0)