summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2024-04-03 22:24:20 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2024-04-12 20:58:35 +0000
commite07230da0500e0919a765037c5e81583b519be2c (patch)
treeb0ef265464e782bd47985a682cab0b9e9f828c36 /fs/f2fs
parent278a6253a673611dbc8ab72a3b34b151a8e75822 (diff)
downloadlwn-e07230da0500e0919a765037c5e81583b519be2c.tar.gz
lwn-e07230da0500e0919a765037c5e81583b519be2c.zip
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: 5fed0be8583f ("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>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index fc3d4d69e72c..681dfa8775ab 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -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;
}