All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix fileattr_set unsupported attribute handling
@ 2022-01-22 12:59 ` Harry Austen
  0 siblings, 0 replies; 12+ messages in thread
From: Harry Austen @ 2022-01-22 12:59 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: jaegeuk, chao, linux-kernel, Harry Austen

FS_IOC_SETFLAGS ioctl should return EOPNOTSUPP if the file attribute
(e.g. FS_NOCOW_FL) is not supported, rather than silently ignoring it
and returning success.

Fixes: 9b1bb01c8ae7 (f2fs: convert to fileattr)
Signed-off-by: Harry Austen <harryausten@hotmail.co.uk>
---
 fs/f2fs/file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 92ec2699bc85..061bf35c2582 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3085,9 +3085,8 @@ int f2fs_fileattr_set(struct user_namespace *mnt_userns,
 		return -EIO;
 	if (!f2fs_is_checkpoint_ready(F2FS_I_SB(inode)))
 		return -ENOSPC;
-	if (fsflags & ~F2FS_GETTABLE_FS_FL)
+	if (fsflags & ~F2FS_SETTABLE_FS_FL)
 		return -EOPNOTSUPP;
-	fsflags &= F2FS_SETTABLE_FS_FL;
 	if (!fa->flags_valid)
 		mask &= FS_COMMON_FL;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-01-30  2:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 12:59 [PATCH] f2fs: fix fileattr_set unsupported attribute handling Harry Austen
2022-01-22 12:59 ` [f2fs-dev] " Harry Austen
2022-01-23  8:52 ` Chao Yu
2022-01-23  8:52   ` [f2fs-dev] " Chao Yu
2022-01-24 19:25 ` Eric Biggers
2022-01-24 19:25   ` Eric Biggers
2022-01-25 22:01   ` Harry Austen
2022-01-25 22:01     ` Harry Austen
2022-01-25 22:13     ` Eric Biggers
2022-01-25 22:13       ` Eric Biggers
2022-01-30  2:43 ` [f2fs] 9ec9c5043d: xfstests.generic.386.fail kernel test robot
2022-01-30  2:43   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.