Commit 5fadbd99 authored by Yang Xu's avatar Yang Xu Committed by Christian Brauner (Microsoft)

ceph: rely on vfs for setgid stripping

Now that we finished moving setgid stripping for regular files in setgid
directories into the vfs, individual filesystem don't need to manually
strip the setgid bit anymore. Drop the now unneeded code from ceph.

Link: https://lore.kernel.org/r/1657779088-2242-4-git-send-email-xuyang2018.jy@fujitsu.comReviewed-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: Christian Brauner (Microsoft)<brauner@kernel.org>
Reviewed-and-Tested-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarYang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
parent 1639a49c
...@@ -657,10 +657,6 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry, ...@@ -657,10 +657,6 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry,
/* Directories always inherit the setgid bit. */ /* Directories always inherit the setgid bit. */
if (S_ISDIR(mode)) if (S_ISDIR(mode))
mode |= S_ISGID; 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 { } else {
in.gid = cpu_to_le32(from_kgid(&init_user_ns, current_fsgid())); in.gid = cpu_to_le32(from_kgid(&init_user_ns, current_fsgid()));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment