linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: fix fileattr_set unsupported attribute handling
@ 2022-01-22 12:59 Harry Austen
  2022-01-23  8:52 ` Chao Yu
  2022-01-24 19:25 ` Eric Biggers
  0 siblings, 2 replies; 5+ messages in thread
From: Harry Austen @ 2022-01-22 12:59 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: jaegeuk, 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



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2022-01-25 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-22 12:59 [f2fs-dev] [PATCH] f2fs: fix fileattr_set unsupported attribute handling Harry Austen
2022-01-23  8:52 ` Chao Yu
2022-01-24 19:25 ` Eric Biggers
2022-01-25 22:01   ` Harry Austen
2022-01-25 22:13     ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).