From: Xiubo Li <xiubli@redhat.com>
To: Yang Xu <xuyang2018.jy@fujitsu.com>,
linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org
Cc: viro@zeniv.linux.org.uk, david@fromorbit.com, djwong@kernel.org,
brauner@kernel.org, willy@infradead.org, jlayton@kernel.org
Subject: Re: [PATCH v5 4/4] ceph: Remove S_ISGID clear code in ceph_finish_async_create
Date: Thu, 21 Apr 2022 16:33:29 +0800 [thread overview]
Message-ID: <71fe92fc-9c91-1070-89f7-27dfba49acfe@redhat.com> (raw)
In-Reply-To: <1650527658-2218-4-git-send-email-xuyang2018.jy@fujitsu.com>
On 4/21/22 3:54 PM, Yang Xu wrote:
> Since vfs has stripped S_ISGID in the previous patch, the calltrace
> as below:
>
> vfs: lookup_open
> ...
> if (open_flag & O_CREAT) {
> if (open_flag & O_EXCL)
> open_flag &= ~O_TRUNC;
> mode = prepare_mode(mnt_userns, dir->d_inode, mode);
> ...
> dir_inode->i_op->atomic_open
>
> ceph: ceph_atomic_open
> ...
> if (flags & O_CREAT)
> ceph_finish_async_create
>
> We have stripped sgid in prepare_mode, so remove this useless clear
> code directly.
>
> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
> fs/ceph/file.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index 6c9e837aa1d3..8e3b99853333 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -651,10 +651,6 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry,
> /* Directories always inherit the setgid bit. */
> if (S_ISDIR(mode))
> mode |= S_ISGID;
> - else if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP) &&
> - !in_group_p(dir->i_gid) &&
> - !capable_wrt_inode_uidgid(&init_user_ns, dir, CAP_FSETID))
> - mode &= ~S_ISGID;
> } else {
> in.gid = cpu_to_le32(from_kgid(&init_user_ns, current_fsgid()));
> }
LGTM.
Reviewed-by: Xiubo Li <xiubli@redhat.com>
next prev parent reply other threads:[~2022-04-21 8:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 7:54 [PATCH v5 1/4] fs: move sgid strip operation from inode_init_owner into inode_sgid_strip Yang Xu
2022-04-21 7:54 ` [PATCH v5 2/4] fs: Add missing umask strip in vfs_tmpfile Yang Xu
2022-04-21 7:24 ` Christian Brauner
2022-04-21 7:54 ` [PATCH v5 3/4] fs: strip file's S_ISGID mode on vfs instead of on underlying filesystem Yang Xu
2022-04-21 8:35 ` Christian Brauner
2022-04-22 6:03 ` xuyang2018.jy
2022-04-22 9:47 ` Christian Brauner
2022-04-22 10:13 ` xuyang2018.jy
2022-04-22 10:49 ` Christian Brauner
2022-04-21 7:54 ` [PATCH v5 4/4] ceph: Remove S_ISGID clear code in ceph_finish_async_create Yang Xu
2022-04-21 8:18 ` Christian Brauner
2022-04-21 8:28 ` xuyang2018.jy
2022-04-21 8:36 ` Christian Brauner
2022-04-21 8:33 ` Xiubo Li [this message]
2022-04-21 8:01 ` [PATCH v5 1/4] fs: move sgid strip operation from inode_init_owner into inode_sgid_strip Christian Brauner
2022-04-21 8:19 ` xuyang2018.jy
2022-04-22 6:53 ` xuyang2018.jy
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=71fe92fc-9c91-1070-89f7-27dfba49acfe@redhat.com \
--to=xiubli@redhat.com \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=xuyang2018.jy@fujitsu.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).