]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: remove redundant atomic file check in defragment
authorZhiguo Niu <zhiguo.niu@unisoc.com>
Thu, 31 Oct 2024 05:59:52 +0000 (13:59 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 1 Nov 2024 01:24:42 +0000 (01:24 +0000)
f2fs_is_atomic_file(inode) is checked in f2fs_defragment_range,
so remove the redundant checking in f2fs_ioc_defragment.

Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 0e7a0195eca8ff9520ff6ea963cd2f14449935c9..b619f7e556406b1f6f5be55df6a539adf4bffbb2 100644 (file)
@@ -2883,7 +2883,7 @@ static int f2fs_ioc_defragment(struct file *filp, unsigned long arg)
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
 
-       if (!S_ISREG(inode->i_mode) || f2fs_is_atomic_file(inode))
+       if (!S_ISREG(inode->i_mode))
                return -EINVAL;
 
        if (f2fs_readonly(sbi->sb))