From: Eric Biggers <ebiggers@kernel.org>
To: Wang Shilong <wshilong@ddn.com>
Cc: Andreas Dilger <adilger@dilger.ca>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
Wang Shilong <wangshilong1991@gmail.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: Fri, 7 Jun 2019 11:14:52 -0700 [thread overview]
Message-ID: <20190607181452.GC648@sol.localdomain> (raw)
In-Reply-To: <MN2PR19MB3167ED3E8C9C85AE510F7BF4D4100@MN2PR19MB3167.namprd19.prod.outlook.com>
On Fri, Jun 07, 2019 at 07:51:18AM +0000, Wang Shilong wrote:
> Hi,
>
> > --
> > 2.21.0
>
> Won't this break 'chattr' on files that already have this flag set?
> FS_IOC_GETFLAGS will return this flag, so 'chattr' will pass it back to
> FS_IOC_SETFLAGS which will return EOPNOTSUPP due to this:
>
> if (ext4_mask_flags(inode->i_mode, flags) != flags)
> return -EOPNOTSUPP;
>
> >>>>
>
> You are right for this and we also need take care of this in EXT4_IOC_FSSETXATTR/
> this is a bit strange behavior as chattr read existed flags
> but could not set them again, there are several possible ways that I could think
> of to fix the issue?
>
> 1) change chattr to filter Project inherit bit before call FS_IOC_SETFLAGS
>
> 2) we automatically fixed the flag before mask check, something like:
> if reg:
> flags &= ~PROJECT_INHERT;
> if (ext4_mask_flags(inode->i_mode, flags) != flags)
> return -EOPNOTSUPP;
> But this might be not good..
>
> I would prefer solution 1)
> What do you think?
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.
- Eric
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: Wang Shilong <wshilong@ddn.com>
Cc: Andreas Dilger <adilger@dilger.ca>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
Wang Shilong <wangshilong1991@gmail.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: Fri, 7 Jun 2019 11:14:52 -0700 [thread overview]
Message-ID: <20190607181452.GC648@sol.localdomain> (raw)
Message-ID: <20190607181452.y5fyUSeAVU7OJ0ZEQ4mMSPsMgHzA13rcVyc9LRq5Aw8@z> (raw)
In-Reply-To: <MN2PR19MB3167ED3E8C9C85AE510F7BF4D4100@MN2PR19MB3167.namprd19.prod.outlook.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 1565 bytes --]
On Fri, Jun 07, 2019 at 07:51:18AM +0000, Wang Shilong wrote:
> Hi,
>
> > --
> > 2.21.0
>
> Won't this break 'chattr' on files that already have this flag set?
> FS_IOC_GETFLAGS will return this flag, so 'chattr' will pass it back to
> FS_IOC_SETFLAGS which will return EOPNOTSUPP due to this:
>
> if (ext4_mask_flags(inode->i_mode, flags) != flags)
> return -EOPNOTSUPP;
>
> >>>>
>
> You are right for this and we also need take care of this in EXT4_IOC_FSSETXATTR/
> this is a bit strange behavior as chattr read existed flags
> but could not set them again, there are several possible ways that I could think
> of to fix the issue?
>
> 1) change chattr to filter Project inherit bit before call FS_IOC_SETFLAGS
>
> 2) we automatically fixed the flag before mask check, something like:
> if reg:
> flags &= ~PROJECT_INHERT;
> if (ext4_mask_flags(inode->i_mode, flags) != flags)
> return -EOPNOTSUPP;
> But this might be not good..
>
> I would prefer solution 1)
> What do you think?
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.
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2019-06-07 18:15 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 [this message]
2019-06-07 18:14 ` 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
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=20190607181452.GC648@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=adilger@dilger.ca \
--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).