diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-04-08 11:27:14 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-05-31 11:31:45 -0700 |
commit | 764811581d1cfb5f8b1c33b90ed4bcdb363e930a (patch) | |
tree | 91a3ae27b2a62cb4394132ae6be1bc3827022e56 /fs/f2fs/file.c | |
parent | c807a7cb543b535063817fbbdca75f515d7ea361 (diff) | |
download | linux-764811581d1cfb5f8b1c33b90ed4bcdb363e930a.tar.bz2 |
f2fs: fix to show missing bits in FS_IOC_GETFLAGS
This patch fixes to show missing encrypt/inline_data flag in
FS_IOC_GETFLAGS like ext4 does.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 74df80ae1728..97bb4af8d8d6 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1584,8 +1584,15 @@ static int f2fs_ioc_getflags(struct file *filp, unsigned long arg) { struct inode *inode = file_inode(filp); struct f2fs_inode_info *fi = F2FS_I(inode); - unsigned int flags = fi->i_flags & - (F2FS_FL_USER_VISIBLE | F2FS_PROJINHERIT_FL); + unsigned int flags = fi->i_flags; + + if (file_is_encrypt(inode)) + flags |= F2FS_ENCRYPT_FL; + if (f2fs_has_inline_data(inode) || f2fs_has_inline_dentry(inode)) + flags |= F2FS_INLINE_DATA_FL; + + flags &= F2FS_FL_USER_VISIBLE; + return put_user(flags, (int __user *)arg); } |