diff mbox series

回复: [PATCH 2/2] f2fs: only set project inherit bit for directory

Message ID MN2PR19MB3167496236BA4D366EAF5D36D4EF0@MN2PR19MB3167.namprd19.prod.outlook.com
State Not Applicable
Headers show
Series 回复: [PATCH 2/2] f2fs: only set project inherit bit for directory | expand

Commit Message

Wang Shilong June 13, 2019, 7:34 a.m. UTC
Hi Chao,

 I just sent a V2, but I think we'd better do that when reading inode, for two reasons:

1) not only F2FS_IOC_GETFLAGS need filter flags but also F2FS_IOC_FSGETXATTR need that, so the amended parts is not enough IMO.

2) doing that by reading inode give a benefit that we could correct on disk flags for regular file next dirtying inode happen.
diff mbox series

Patch

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index efdafa886510..295ca5ed42d9 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1759,6 +1759,9 @@  static int f2fs_ioc_getflags(struct file *filp, unsigned
long arg)

        fsflags &= F2FS_GETTABLE_FS_FL;

+       if (S_ISREG(inode->i_mode))
+               fsflags &= ~FS_PROJINHERIT_FL;
+
        return put_user(fsflags, (int __user *)arg);
 }