diff options
| author | Chao Yu <yuchao0@huawei.com> | 2017-08-30 18:04:47 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-10-04 15:35:25 +0200 |
| commit | 75b2c7238af30dd436f0366b6bc028476d2b500f (patch) | |
| tree | fed82919eddeb5397ce9f91f699479c503acddc2 | |
| parent | 59e016bc297f4bd67aadf38993e8cdee0799a1aa (diff) | |
f2fs: update i_flags correctly
f2fs enables hash-indexed directory by default, so we need to tag
FS_INDEX_FL in inode::i_flags during directory creataion, in order
to show correct status of inode in lsattr:
Before:
------------------- /mnt/f2fs/dir/
After:
-----------I------- /mnt/f2fs/dir/
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/namei.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 3c404cd32..822d40e1a 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -98,6 +98,9 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) F2FS_I(inode)->i_flags = f2fs_mask_flags(mode, F2FS_I(dir)->i_flags & F2FS_FL_INHERITED); + if (S_ISDIR(inode->i_mode)) + F2FS_I(inode)->i_flags |= FS_INDEX_FL; + if (F2FS_I(inode)->i_flags & FS_PROJINHERIT_FL) set_inode_flag(inode, FI_PROJ_INHERIT); |
