All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Shilong <wshilong@ddn.com>
To: Chao Yu <yuchao0@huawei.com>,
	Wang Shilong <wangshilong1991@gmail.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"linux-f2fs-devel@lists.sourceforge.net" 
	<linux-f2fs-devel@lists.sourceforge.net>
Cc: Andreas Dilger <adilger@dilger.ca>
Subject: 回复: [PATCH 2/2] f2fs: only set project inherit bit for directory
Date: Thu, 13 Jun 2019 07:34:09 +0000	[thread overview]
Message-ID: <MN2PR19MB3167496236BA4D366EAF5D36D4EF0@MN2PR19MB3167.namprd19.prod.outlook.com> (raw)
In-Reply-To: <73fb9e88-d3f5-9420-d6d8-82ff4354e4d6@huawei.com>

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.

________________________________________
发件人: Chao Yu <yuchao0@huawei.com>
发送时间: 2019年6月13日 14:36
收件人: Wang Shilong; linux-ext4@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
抄送: Wang Shilong; Andreas Dilger
主题: Re: [PATCH 2/2] f2fs: only set project inherit bit for directory

On 2019/6/6 12:32, Wang Shilong wrote:
> From: Wang Shilong <wshilong@ddn.com>
>
> It doesn't make any sense to have project inherit bits
> for regular files, even though this won't cause any
> problem, but it is better fix this.
>
> Cc: Andreas Dilger <adilger@dilger.ca>
> Signed-off-by: Wang Shilong <wshilong@ddn.com>
> ---
>  fs/f2fs/f2fs.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 06b89a9862ab..f02ebecb68ea 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -2370,7 +2370,8 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr)
>                          F2FS_PROJINHERIT_FL)
>
>  /* Flags that are appropriate for regular files (all but dir-specific ones). */
> -#define F2FS_REG_FLMASK              (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL))
> +#define F2FS_REG_FLMASK      (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL |\
> +                                F2FS_PROJINHERIT_FL))

Hi Shilong,

Could you please add below diff as ext4 did?

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);
 }

Thanks,

>
>  /* Flags that are appropriate for non-directories/regular files. */
>  #define F2FS_OTHER_FLMASK    (F2FS_NODUMP_FL | F2FS_NOATIME_FL)
>

WARNING: multiple messages have this Message-ID (diff)
From: Wang Shilong via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Chao Yu <yuchao0@huawei.com>,
	Wang Shilong <wangshilong1991@gmail.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Cc: Andreas Dilger <adilger@dilger.ca>
Subject: 回复: [PATCH 2/2] f2fs: only set project inherit bit for directory
Date: Thu, 13 Jun 2019 07:34:09 +0000	[thread overview]
Message-ID: <MN2PR19MB3167496236BA4D366EAF5D36D4EF0@MN2PR19MB3167.namprd19.prod.outlook.com> (raw)
In-Reply-To: <73fb9e88-d3f5-9420-d6d8-82ff4354e4d6@huawei.com>

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.

________________________________________
发件人: Chao Yu <yuchao0@huawei.com>
发送时间: 2019年6月13日 14:36
收件人: Wang Shilong; linux-ext4@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
抄送: Wang Shilong; Andreas Dilger
主题: Re: [PATCH 2/2] f2fs: only set project inherit bit for directory

On 2019/6/6 12:32, Wang Shilong wrote:
> From: Wang Shilong <wshilong@ddn.com>
>
> It doesn't make any sense to have project inherit bits
> for regular files, even though this won't cause any
> problem, but it is better fix this.
>
> Cc: Andreas Dilger <adilger@dilger.ca>
> Signed-off-by: Wang Shilong <wshilong@ddn.com>
> ---
>  fs/f2fs/f2fs.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 06b89a9862ab..f02ebecb68ea 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -2370,7 +2370,8 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr)
>                          F2FS_PROJINHERIT_FL)
>
>  /* Flags that are appropriate for regular files (all but dir-specific ones). */
> -#define F2FS_REG_FLMASK              (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL))
> +#define F2FS_REG_FLMASK      (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL |\
> +                                F2FS_PROJINHERIT_FL))

Hi Shilong,

Could you please add below diff as ext4 did?

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);
 }

Thanks,

>
>  /* Flags that are appropriate for non-directories/regular files. */
>  #define F2FS_OTHER_FLMASK    (F2FS_NODUMP_FL | F2FS_NOATIME_FL)
>

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Wang Shilong via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Chao Yu <yuchao0@huawei.com>,
	Wang Shilong <wangshilong1991@gmail.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	"linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Cc: Andreas Dilger <adilger@dilger.ca>
Subject: [f2fs-dev] 回复: [PATCH 2/2] f2fs: only set project inherit bit for directory
Date: Thu, 13 Jun 2019 07:34:09 +0000	[thread overview]
Message-ID: <MN2PR19MB3167496236BA4D366EAF5D36D4EF0@MN2PR19MB3167.namprd19.prod.outlook.com> (raw)
Message-ID: <20190613073409.y6M-HhJkb3Rcsh3Bwcgu0cooBV6nqyq8D1rEpozchrI@z> (raw)
In-Reply-To: <73fb9e88-d3f5-9420-d6d8-82ff4354e4d6@huawei.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 2484 bytes --]

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.

________________________________________
·¢¼þÈË: Chao Yu <yuchao0@huawei.com>
·¢ËÍʱ¼ä: 2019Äê6ÔÂ13ÈÕ 14:36
ÊÕ¼þÈË: Wang Shilong; linux-ext4@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
³­ËÍ: Wang Shilong; Andreas Dilger
Ö÷Ìâ: Re: [PATCH 2/2] f2fs: only set project inherit bit for directory

On 2019/6/6 12:32, Wang Shilong wrote:
> From: Wang Shilong <wshilong@ddn.com>
>
> It doesn't make any sense to have project inherit bits
> for regular files, even though this won't cause any
> problem, but it is better fix this.
>
> Cc: Andreas Dilger <adilger@dilger.ca>
> Signed-off-by: Wang Shilong <wshilong@ddn.com>
> ---
>  fs/f2fs/f2fs.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 06b89a9862ab..f02ebecb68ea 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -2370,7 +2370,8 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr)
>                          F2FS_PROJINHERIT_FL)
>
>  /* Flags that are appropriate for regular files (all but dir-specific ones). */
> -#define F2FS_REG_FLMASK              (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL))
> +#define F2FS_REG_FLMASK      (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL |\
> +                                F2FS_PROJINHERIT_FL))

Hi Shilong,

Could you please add below diff as ext4 did?

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);
 }

Thanks,

>
>  /* Flags that are appropriate for non-directories/regular files. */
>  #define F2FS_OTHER_FLMASK    (F2FS_NODUMP_FL | F2FS_NOATIME_FL)
>

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2019-06-13 16:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06  4:32 [PATCH 1/2] ext4: only set project inherit bit for directory Wang Shilong
2019-06-06  4:32 ` Wang Shilong
2019-06-06  4:32 ` [PATCH 2/2] f2fs: " Wang Shilong
2019-06-06  4:32   ` Wang Shilong
2019-06-13  6:36   ` Chao Yu
2019-06-13  6:36     ` [f2fs-dev] " Chao Yu
2019-06-13  6:36     ` Chao Yu
2019-06-13  7:34     ` Wang Shilong [this message]
2019-06-13  7:34       ` [f2fs-dev] 回复: " Wang Shilong via Linux-f2fs-devel
2019-06-13  7:34       ` Wang Shilong via Linux-f2fs-devel
2019-06-13  8:03       ` Chao Yu
2019-06-13  8:03         ` [f2fs-dev] " Chao Yu
2019-06-13  8:03         ` Chao Yu
2019-06-06 15:30 ` [PATCH 1/2] ext4: " Darrick J. Wong
2019-06-06 15:30   ` [f2fs-dev] " Darrick J. Wong
2019-06-06 15:30   ` Darrick J. Wong
2019-06-06 20:50 ` Andreas Dilger
2019-06-06 22:45 ` [f2fs-dev] " Eric Biggers
2019-06-06 22:45   ` Eric Biggers
2019-06-06 22:45   ` Eric Biggers
2019-06-07  7:51   ` 回复: [f2fs-dev] " Wang Shilong
2019-06-07  7:51     ` [f2fs-dev] 回复: " Wang Shilong via Linux-f2fs-devel
2019-06-07  7:51     ` Wang Shilong via Linux-f2fs-devel
2019-06-07 18:14     ` 回复: [f2fs-dev] " Eric Biggers
2019-06-07 18:14       ` [f2fs-dev] 回复: " Eric Biggers
2019-06-07 18:14       ` Eric Biggers
2019-06-08  1:15       ` 回复: 回复: [f2fs-dev] " Wang Shilong
2019-06-08  1:15         ` [f2fs-dev] 回复: 回复: " Wang Shilong via Linux-f2fs-devel
2019-06-08  1:15         ` Wang Shilong via Linux-f2fs-devel
2019-06-10  4:38       ` 回复: [f2fs-dev] " Theodore Ts'o
2019-06-10  4:38         ` [f2fs-dev] 回复: " Theodore Ts'o
2019-06-10  4:38         ` Theodore Ts'o
2019-06-10  4:15 ` Theodore Ts'o
2019-06-10  4:15   ` [f2fs-dev] " Theodore Ts'o
2019-06-10  4:15   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR19MB3167496236BA4D366EAF5D36D4EF0@MN2PR19MB3167.namprd19.prod.outlook.com \
    --to=wshilong@ddn.com \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=wangshilong1991@gmail.com \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.