Message ID | 1653063037-2461-4-git-send-email-xuyang2018.jy@fujitsu.com |
---|---|
State | New |
Headers | show |
Series | [v9,1/4] fs: add mode_strip_sgid() helper | expand |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 8c8226c0feac..257ec53b1765 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -657,10 +657,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())); }