linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Andreas Dilger <adilger@dilger.ca>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	Wang Shilong <wangshilong1991@gmail.com>,
	Wang Shilong <wshilong@ddn.com>,
	"linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: 回复:  [PATCH 1/2] ext4: only set project inherit bit for directory
Date: Mon, 10 Jun 2019 00:38:28 -0400	[thread overview]
Message-ID: <20190610043828.GC15963@mit.edu> (raw)
In-Reply-To: <20190607181452.GC648@sol.localdomain>

On Fri, Jun 07, 2019 at 11:14:52AM -0700, Eric Biggers wrote:
> 
> Existing versions of chattr can't be changed, and people don't necessarily
> upgrade the kernel and e2fsprogs at the same time.  So (1) wouldn't really work.
> 
> A better solution might be to make FS_IOC_GETFLAGS and FS_IOC_FSGETXATTR never
> return the project inherit flag on regular files.

I've amended this patch by adding the following to fix it for
FS_IOC_GETFLAGS (which is chattr uses):

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 7af835ac8d23..74648d42c69b 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -779,6 +779,8 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		return ext4_ioc_getfsmap(sb, (void __user *)arg);
 	case EXT4_IOC_GETFLAGS:
 		flags = ei->i_flags & EXT4_FL_USER_VISIBLE;
+		if (S_ISREG(inode->i_mode))
+			flags &= ~EXT4_PROJINHERIT_FL;
 		return put_user(flags, (int __user *) arg);
 	case EXT4_IOC_SETFLAGS: {
 		int err;

						- Ted

WARNING: multiple messages have this Message-ID (diff)
From: "Theodore Ts'o" <tytso@mit.edu>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Andreas Dilger <adilger@dilger.ca>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	Wang Shilong <wangshilong1991@gmail.com>,
	Wang Shilong <wshilong@ddn.com>,
	"linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] 回复:  [PATCH 1/2] ext4: only set project inherit bit for directory
Date: Mon, 10 Jun 2019 00:38:28 -0400	[thread overview]
Message-ID: <20190610043828.GC15963@mit.edu> (raw)
Message-ID: <20190610043828.5G7ozKZ45OOggrXqzTf_46O37NwmdUIvDKNZzcL20l8@z> (raw)
In-Reply-To: <20190607181452.GC648@sol.localdomain>

On Fri, Jun 07, 2019 at 11:14:52AM -0700, Eric Biggers wrote:
> 
> Existing versions of chattr can't be changed, and people don't necessarily
> upgrade the kernel and e2fsprogs at the same time.  So (1) wouldn't really work.
> 
> A better solution might be to make FS_IOC_GETFLAGS and FS_IOC_FSGETXATTR never
> return the project inherit flag on regular files.

I've amended this patch by adding the following to fix it for
FS_IOC_GETFLAGS (which is chattr uses):

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 7af835ac8d23..74648d42c69b 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -779,6 +779,8 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		return ext4_ioc_getfsmap(sb, (void __user *)arg);
 	case EXT4_IOC_GETFLAGS:
 		flags = ei->i_flags & EXT4_FL_USER_VISIBLE;
+		if (S_ISREG(inode->i_mode))
+			flags &= ~EXT4_PROJINHERIT_FL;
 		return put_user(flags, (int __user *) arg);
 	case EXT4_IOC_SETFLAGS: {
 		int err;

						- Ted


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

  parent reply	other threads:[~2019-06-10  4:38 UTC|newest]

Thread overview: 22+ 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 ` [PATCH 2/2] f2fs: " Wang Shilong
2019-06-13  6:36   ` Chao Yu
2019-06-13  6:36     ` [f2fs-dev] " Chao Yu
2019-06-13  7:34     ` 回复: " Wang Shilong via Linux-f2fs-devel
2019-06-13  7:34       ` [f2fs-dev] " Wang Shilong via Linux-f2fs-devel
2019-06-13  8:03       ` Chao Yu
2019-06-13  8:03         ` [f2fs-dev] " 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 22:45 ` Eric Biggers
2019-06-06 22:45   ` [f2fs-dev] " Eric Biggers
2019-06-07  7:51   ` 回复: " Wang Shilong via Linux-f2fs-devel
2019-06-07  7:51     ` [f2fs-dev] " Wang Shilong via Linux-f2fs-devel
2019-06-07 18:14     ` Eric Biggers
2019-06-07 18:14       ` [f2fs-dev] " Eric Biggers
2019-06-08  1:15       ` 回复: " Wang Shilong via Linux-f2fs-devel
2019-06-08  1:15         ` [f2fs-dev] " Wang Shilong via Linux-f2fs-devel
2019-06-10  4:38       ` Theodore Ts'o [this message]
2019-06-10  4:38         ` [f2fs-dev] " Theodore Ts'o
2019-06-10  4:15 ` Theodore Ts'o
2019-06-10  4:15   ` [f2fs-dev] " 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=20190610043828.GC15963@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=ebiggers@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=wangshilong1991@gmail.com \
    --cc=wshilong@ddn.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).