mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix to show encrypt flag in FS_IOC_GETFLAGS
@ 2018-04-02 10:24 Chao Yu
  2018-04-02 20:21 ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Chao Yu @ 2018-04-02 10:24 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, chao, Chao Yu

This patch fixes to show encrypt flag in FS_IOC_GETFLAGS like ext4 does.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/f2fs/file.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 8068b015ece5..271fadadaa36 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1584,8 +1584,13 @@ 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 &
-			(FS_FL_USER_VISIBLE | FS_PROJINHERIT_FL);
+	unsigned int flags = fi->i_flags;
+
+	if (file_is_encrypt(inode))
+		flags |= FS_ENCRYPT_FL;
+
+	flags &= FS_FL_USER_VISIBLE | FS_PROJINHERIT_FL;
+
 	return put_user(flags, (int __user *)arg);
 }
 
-- 
2.15.0.55.gc2ece9dc4de6

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-08  1:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-02 10:24 [PATCH] f2fs: fix to show encrypt flag in FS_IOC_GETFLAGS Chao Yu
2018-04-02 20:21 ` Jaegeuk Kim
2018-04-03  7:14   ` Chao Yu
2018-04-05  3:46     ` Jaegeuk Kim
2018-04-08  1:15       ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome