From patchwork Thu Apr 14 07:57:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang Xu (Fujitsu)" X-Patchwork-Id: 12813005 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 1F197C433FE for ; Thu, 14 Apr 2022 06:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240188AbiDNG7v (ORCPT ); Thu, 14 Apr 2022 02:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239661AbiDNG7s (ORCPT ); Thu, 14 Apr 2022 02:59:48 -0400 Received: from mail1.bemta36.messagelabs.com (mail1.bemta36.messagelabs.com [85.158.142.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57EF4541AB; Wed, 13 Apr 2022 23:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1649919442; i=@fujitsu.com; bh=2BEBt+KtqG1w23kjA03oL0N4j7CMYSd/9MBWpZADdAw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iwSsDcpvAvkjUEu64lNDvisMQWbNpRIiqVDmoINWJgHiFAmbWxl/p2P6McLBslCpX RAsKK6q2qBPEKXHYgs+sk4iVTRTvXxtX8WMY5etCjrKoA5ig8pK32FDjwJn4BDSxAD 4Ip2yRsrWRzu0lfRrOK1jhodvPBHx4WeRjBaagVEcnDV3HtLv6ZkrUlkhty7hNhlWx 2KT/pkYv1Vuj31v/ou+vJmTY77rOLlHgnYTAW7L1xSBp9W6RklHNzx5W+H5W+g429h g4QbknfT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m2Ar4+3cK/XfUEaW tYTxioeU3rVck0CzeXbnLd81bj/qvVas8+yeoNsn5aq4rddv/N8SsdxsBov63f0O/m/ZDiyUf CTYKfx1jYyxEktxRqKhFnNRcSIA27pvNpYDAAA= X-Env-Sender: xuyang2018.jy@fujitsu.com X-Msg-Ref: server-23.tower-532.messagelabs.com!1649919441!33213!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 17612 invoked from network); 14 Apr 2022 06:57:21 -0000 Received: from unknown (HELO n03ukasimr01.n03.fujitsu.local) (62.60.8.97) by server-23.tower-532.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Apr 2022 06:57:21 -0000 Received: from n03ukasimr01.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr01.n03.fujitsu.local (Postfix) with ESMTP id 61CB6100199; Thu, 14 Apr 2022 07:57:21 +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 54D7D100181; Thu, 14 Apr 2022 07:57:21 +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; Thu, 14 Apr 2022 07:56:53 +0100 From: Yang Xu To: , , CC: , , , , , Yang Xu Subject: [PATCH v2 3/3] ceph: Remove S_ISGID clear code in ceph_finish_async_create Date: Thu, 14 Apr 2022 15:57:19 +0800 Message-ID: <1649923039-2273-3-git-send-email-xuyang2018.jy@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1649923039-2273-1-git-send-email-xuyang2018.jy@fujitsu.com> References: <1649923039-2273-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 Since vfs has stripped S_ISGID, we don't need this code any more. 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())); }