[PATCH 1/2] f2fs: remove redundant atomic file check in defragment

From: Zhiguo Niu
Date: Thu Oct 31 2024 - 02:01:05 EST


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@xxxxxxxxxx>
---
fs/f2fs/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 75a8b22..3e22f6e 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -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))
--
1.9.1