From patchwork Mon Apr 25 03:09:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 565725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 500B8C433EF for ; Mon, 25 Apr 2022 02:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240325AbiDYCNL (ORCPT ); Sun, 24 Apr 2022 22:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240351AbiDYCMv (ORCPT ); Sun, 24 Apr 2022 22:12:51 -0400 Received: from mail1.bemta32.messagelabs.com (mail1.bemta32.messagelabs.com [195.245.230.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DE542980B; Sun, 24 Apr 2022 19:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1650852587; i=@fujitsu.com; bh=c5FCpwWbwNZnqJjma6yo9VosB0Dzi2MqAMD84YLxtik=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HT2GkfBb5ARGC/yOfCN/H3kYyu3MhPrqCth/YvTncsD73iOvgTrvfEjJtZIerN7RB /Af8L4QEQHcUh9AOYS9R5nBi1q7P3rmU/c8LQXP7jyZjTnR+K45skttRidLab7J47c nzOPA1OW7lGCtOOQOremcQJ0wyzbF6pinlaQ/5rzgJ7UQ2LMUjmbgIG+0bYLiek4OG u/ozDswlOKy18QGH6qbw2/NG4qVUmwZn6keIvAlyE4CIr+rlkoNFsaKfffOLejXAsu W96q8QYADpht1nuPle9wDBoPOh5C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0FgjtnvHD7ahV tVd+EZOmPn/XpoSNW85mhc9VeDFFa/JhgWT/+j6VHifT3v6lbO4KXZ2/2PUFvhpsOnPDKO4I1 63dEgKzw/lFzwi2e8TkxBu7KLEUZyQaajEXFScCAH/rVhicAwAA X-Env-Sender: xuyang2018.jy@fujitsu.com X-Msg-Ref: server-18.tower-591.messagelabs.com!1650852581!113011!1 X-Originating-IP: [62.60.8.97] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.85.8; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14581 invoked from network); 25 Apr 2022 02:09:41 -0000 Received: from unknown (HELO n03ukasimr01.n03.fujitsu.local) (62.60.8.97) by server-18.tower-591.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 25 Apr 2022 02:09:41 -0000 Received: from n03ukasimr01.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr01.n03.fujitsu.local (Postfix) with ESMTP id 5E776100193; Mon, 25 Apr 2022 03:09:41 +0100 (BST) Received: from R01UKEXCASM126.r01.fujitsu.local (unknown [10.183.43.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr01.n03.fujitsu.local (Postfix) with ESMTPS id 4248310018F; Mon, 25 Apr 2022 03:09:41 +0100 (BST) Received: from localhost.localdomain (10.167.220.84) by R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 25 Apr 2022 03:09:14 +0100 From: Yang Xu To: , CC: , , , , , , Yang Xu Subject: [PATCH v6 4/4] ceph: Remove S_ISGID stripping code in ceph_finish_async_create Date: Mon, 25 Apr 2022 11:09:41 +0800 Message-ID: <1650856181-21350-4-git-send-email-xuyang2018.jy@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1650856181-21350-1-git-send-email-xuyang2018.jy@fujitsu.com> References: <1650856181-21350-1-git-send-email-xuyang2018.jy@fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) To R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Previous patches moved sgid stripping exclusively into the vfs. So manual sgid stripping by the filesystem isn't needed anymore. Reviewed-by: Xiubo Li Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Yang Xu --- 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())); }