Commit 5043a964 authored by Wang Shilong's avatar Wang Shilong Committed by Jaegeuk Kim

f2fs: only set project inherit bit for directory

It doesn't make any sense to have project inherit bits
for regular files, even though this won't cause any
problem, but it is better fix this.

Cc: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: default avatarWang Shilong <wshilong@ddn.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 36098557
...@@ -2350,7 +2350,7 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr) ...@@ -2350,7 +2350,7 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr)
F2FS_DIRSYNC_FL | F2FS_PROJINHERIT_FL) F2FS_DIRSYNC_FL | F2FS_PROJINHERIT_FL)
/* Flags that are appropriate for regular files (all but dir-specific ones). */ /* Flags that are appropriate for regular files (all but dir-specific ones). */
#define F2FS_REG_FLMASK (~F2FS_DIRSYNC_FL) #define F2FS_REG_FLMASK (~(F2FS_DIRSYNC_FL | F2FS_PROJINHERIT_FL))
/* Flags that are appropriate for non-directories/regular files. */ /* Flags that are appropriate for non-directories/regular files. */
#define F2FS_OTHER_FLMASK (F2FS_NODUMP_FL | F2FS_NOATIME_FL) #define F2FS_OTHER_FLMASK (F2FS_NODUMP_FL | F2FS_NOATIME_FL)
......
...@@ -343,6 +343,8 @@ static int do_read_inode(struct inode *inode) ...@@ -343,6 +343,8 @@ static int do_read_inode(struct inode *inode)
le16_to_cpu(ri->i_gc_failures); le16_to_cpu(ri->i_gc_failures);
fi->i_xattr_nid = le32_to_cpu(ri->i_xattr_nid); fi->i_xattr_nid = le32_to_cpu(ri->i_xattr_nid);
fi->i_flags = le32_to_cpu(ri->i_flags); fi->i_flags = le32_to_cpu(ri->i_flags);
if (S_ISREG(inode->i_mode))
fi->i_flags &= ~F2FS_PROJINHERIT_FL;
fi->flags = 0; fi->flags = 0;
fi->i_advise = ri->i_advise; fi->i_advise = ri->i_advise;
fi->i_pino = le32_to_cpu(ri->i_pino); fi->i_pino = le32_to_cpu(ri->i_pino);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment