In f2fs_fileattr_set(),

        if (!fa->flags_valid)
                mask &= FS_COMMON_FL;

In this case, we can set supported flags by mask only instead of BUG_ON.

/* Flags shared betwen flags/xflags */
        (FS_SYNC_FL | FS_IMMUTABLE_FL | FS_APPEND_FL | \
         FS_NODUMP_FL | FS_NOATIME_FL | FS_DAX_FL | \
         FS_PROJINHERIT_FL)

Fixes: 4c5b47997521 ("vfs: add fileattr ops")
Signed-off-by: Jaegeuk Kim <jaeg...@kernel.org>
---
 fs/f2fs/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 44a4650aea7b..ceb575f99048 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1817,7 +1817,8 @@ static int f2fs_setflags_common(struct inode *inode, u32 
iflags, u32 mask)
        struct f2fs_inode_info *fi = F2FS_I(inode);
        u32 masked_flags = fi->i_flags & mask;
 
-       f2fs_bug_on(F2FS_I_SB(inode), (iflags & ~mask));
+       /* mask can be shrunk by flags_valid selector */
+       iflags &= mask;
 
        /* Is it quota file? Do not allow user to mess with it */
        if (IS_NOQUOTA(inode))
-- 
2.31.1.607.g51e8a6a459-goog



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

Reply via email to