diff options
author | Chao Yu <chao@kernel.org> | 2024-04-03 22:24:20 +0800 |
---|---|---|
committer | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-04-26 23:07:15 +0000 |
commit | ce34b2684751078707c5e0027f6cd02734ba4e88 (patch) | |
tree | 3e6349b7ec2cd8a33aebc63101353b581e27678e | |
parent | e9767e5389057c47b3ad0c0aa27e07a8203fa840 (diff) | |
download | common-ce34b2684751078707c5e0027f6cd02734ba4e88.tar.gz |
FROMGIT: 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")
Change-Id: Ibdc890fb2311d8035e7c5f218b179b8a262bc414
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit e07230da0500e0919a765037c5e81583b519be2c
https: //git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
-rw-r--r-- | fs/f2fs/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 2575172750c2..4f2f0267a345 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; } |