Skip to content

Commit

Permalink
f2fs: support iflag change given the mask
Browse files Browse the repository at this point in the history
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: 9b1bb01 ("f2fs: convert to fileattr")
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
Jaegeuk Kim committed May 11, 2021
1 parent 349c4d6 commit a753103
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a753103

Please sign in to comment.