From patchwork Tue Apr 26 04:19:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 566174 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 BF827C433F5 for ; Tue, 26 Apr 2022 03:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242984AbiDZDWy (ORCPT ); Mon, 25 Apr 2022 23:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240250AbiDZDWr (ORCPT ); Mon, 25 Apr 2022 23:22:47 -0400 Received: from mail1.bemta36.messagelabs.com (mail1.bemta36.messagelabs.com [85.158.142.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8EC939BC; Mon, 25 Apr 2022 20:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1650943179; i=@fujitsu.com; bh=c5FCpwWbwNZnqJjma6yo9VosB0Dzi2MqAMD84YLxtik=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fUXBqVyEvw/5IispoMnJ1mjZEEqWRIQQeu7OyjUoadguRMM1XKYIRmfXke8qkFPiy btgwT+2QHUwHziBNmlE1NN6nj3EnSNUEEvxwcsuqzeG7dQLzzCYb7l4cDIi+CQP/fg 7A8mO+AvD6SJ+R/WcUNj0bDcTbNrFop9A4ZUE15tYc4ubDJ0AYJUCJJGwaps51WAR/ x6DphjzhiCoayBaKBSVXz3oXBXzxIiIZ0toQFkkZFhwq4YoTorqFzegpIyYcVcsbF9 2noE9aIocBUHl+kops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51JPzf0nXE9mblA26qocMb2Rc4LHvgvniB3sCBFiPN9zqPughjhMz57n/RelRFPefc2l9Fc0 ESJpTgj0VCLuag4EQCCJj5IiQMAAA== X-Env-Sender: xuyang2018.jy@fujitsu.com X-Msg-Ref: server-20.tower-532.messagelabs.com!1650943177!213272!1 X-Originating-IP: [62.60.8.148] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.85.8; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4507 invoked from network); 26 Apr 2022 03:19:38 -0000 Received: from unknown (HELO mailhost1.uk.fujitsu.com) (62.60.8.148) by server-20.tower-532.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 26 Apr 2022 03:19:38 -0000 Received: from R01UKEXCASM126.r01.fujitsu.local ([10.183.43.178]) by mailhost1.uk.fujitsu.com (8.14.5/8.14.5) with ESMTP id 23Q3Jb7O022457 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 26 Apr 2022 04:19:37 +0100 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; Tue, 26 Apr 2022 04:19:33 +0100 From: Yang Xu To: , CC: , , , , , , Yang Xu Subject: [PATCH v7 4/4] ceph: Remove S_ISGID stripping code in ceph_finish_async_create Date: Tue, 26 Apr 2022 12:19:52 +0800 Message-ID: <1650946792-9545-4-git-send-email-xuyang2018.jy@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1650946792-9545-1-git-send-email-xuyang2018.jy@fujitsu.com> References: <1650946792-9545-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) 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())); }