Skip to contentSkip to conversation

f2fs: fix to show missing bits in FS_IOC_GETFLAGS

PATCH New Chao Yu 1 participant 1 message Apr 8, 2018 F2FS file system

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 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.

---
 fs/f2fs/file.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
fs/f2fs/file.c +9 -2
index 3fd485395f9d..79cfaad21705 100644
@@ -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);
 }
 
Signature · 1 line
2.15.0.55.gc2ece9dc4de6