From patchwork Mon Apr 3 11:04:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 78507 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2225371vqo; Mon, 3 Apr 2023 04:25:12 -0700 (PDT) X-Google-Smtp-Source: AK7set9ASxp1M+dXo6IWSAGvCHz43LRIYsYuDtyXBpCxcpo1QhhUxyQ5x4BrbBaMI/8wcY8Dpnzt X-Received: by 2002:a05:6a20:4f9e:b0:d4:32bb:11bd with SMTP id gh30-20020a056a204f9e00b000d432bb11bdmr25347389pzb.45.1680521112007; Mon, 03 Apr 2023 04:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680521111; cv=none; d=google.com; s=arc-20160816; b=oRYsGB9hCDGBoW7Jmo3EJYeTKHZMZi9IYAld3mLItLIijJLMqLKn/u6anBuEGrb7ro yUKlVRwRzL0rHphePTxBpuoA0ngDg9z/lLxUuNTbvNHTu6gSGVBo3b41MCCZOOz28o4N QN2wbmLJQ1ryPUlEWGbBA6hsWBf3ac7hjhX6knIo0xx7vGrmrZdMy2CsY7e0AoXRGqSD aGpGtzax0WFMW3M6ghBvJWXgKzj47+LZ2Z0MtOrQ+BAMmlOW37K1HSpxO21GuWaHjVNt a5vy4r7mJdycFcV7lLDp51AAUYSgPkJr8S7XfkJuDAiTCZuNjSs66g99e2ml+EClvsg6 yIgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oR1Z4m1t//4+REKTL9P+WMPblp5qMk6gtfBje6PQhKk=; b=Ce6igjcIH2B9F4iILLhJ+ShHag1N7NumJ6r/YsmfcbsTLxtcSHzH1yWgCGq+4jMteX nt/CHsIGoTHePfHQp9VtFGZf/p1lLOWDvwUtvPXFWHhDkRBX9JiXp1G/6lvQAXlnIAMt wV0cSSjJRfAWjFpOlDHcWRsEMdNjImKmyCas/ZyAnEBhNU8K+8TAToZDd50oACPD9yKy MC+lxgl+oRYHmCODAshJSN/ygF2uwTcc/b5bA1B3IvR9wKTaGTSrDX9+v6bBIwYCmGsN T7EzxCR3hnIISuWCN8hq0T2sD1gbA4Sr+nsOSqELnbvfh8nPKcXEAt9AsVkHOExQoilj rycA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cEijF6+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h189-20020a6383c6000000b005138fff7984si3861296pge.38.2023.04.03.04.24.59; Mon, 03 Apr 2023 04:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cEijF6+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbjDCLFm (ORCPT + 99 others); Mon, 3 Apr 2023 07:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbjDCLFk (ORCPT ); Mon, 3 Apr 2023 07:05:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 510CF6182; Mon, 3 Apr 2023 04:05:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CCC1E61919; Mon, 3 Apr 2023 11:05:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDCB4C433EF; Mon, 3 Apr 2023 11:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680519928; bh=xI3/YfoFxE8WIdxxEZQWKtxqgyl7qkson5uhA1hbjG8=; h=From:To:Cc:Subject:Date:From; b=cEijF6+YBLYWt/QLBG5Q6UmfPIwI40uMmM6kNhLJdgtdh37xNu55gDESh5y1WeBDg dCjaFpziENu9/JqReXQvz+mwRWNwBoUq7lz9P4yiTZMlK54jfOnq2EzPKneBUdsD11 qCOxBVDtI5ghPohtxG+eLQ426flxwR6p6amgpDF3/ee0cxE++CoVIrZp1Qz9ZkqE14 FJuuzZnJacCaVkflHlhrWtOp1VxiT130EKpESq57XoPnbF02dvBfJszBDYsaWSl6Ab RjsrG4eIP9h4WnVNtL+Dhv+7nNgxnNn4P/C5HkLrRIxBIH6v289Dfq+R8odTlT4s9Q dQg6F2DfPiYrw== From: Christian Brauner To: Linus Torvalds Cc: Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] vfs fixes Date: Mon, 3 Apr 2023 13:04:58 +0200 Message-Id: <20230403-hardener-elevate-44493c0e466b@brauner> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2270; i=brauner@kernel.org; h=from:subject:message-id; bh=xI3/YfoFxE8WIdxxEZQWKtxqgyl7qkson5uhA1hbjG8=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMaRobTrvMf3nwt86oXuXRXA9unSlOXv5pl/O3zxcpKPrwuft qzcT6ihlYRDjYpAVU2RxaDcJl1vOU7HZKFMDZg4rE8gQBi5OAZjI1euMDB8szfbVfGu4/eHp8V6xjX La991XcW/Uywm7aeB9t2fz+nUM/1MtDLeq7Tg1P/a1VPTHvdMbdkfY7JTctYe5vdi5foJKBgMA X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762154105166824956?= X-GMAIL-MSGID: =?utf-8?q?1762154105166824956?= Hey Linus, /* Summary */ When a mount or mount tree is made shared the vfs allocates new peer group ids for all mounts that have no peer group id set. Only mounts that aren't marked with MNT_SHARED are relevant here as MNT_SHARED indicates that the mount has fully transitioned to a shared mount. The peer group id handling is done with namespace lock held. On failure, the peer group id settings of mounts for which a new peer group id was allocated need to be reverted and the allocated peer group id freed. The cleanup_group_ids() helper can identify the mounts to cleanup by checking whether a given mount has a peer group id set but isn't marked MNT_SHARED. The deallocation always needs to happen with namespace lock held to protect against concurrent modifications of the propagation settings. This pull request contains a fix for the one place where the namespace lock was dropped before calling cleanup_group_ids(). /* Testing */ clang: Ubuntu clang version 15.0.6 gcc: gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0 All patches are based on v6.3-rc4 and have been sitting in linux-next. No build failures or warnings were observed. All old and new tests in fstests, selftests, and LTP pass without regressions. /* Conflicts */ At the time of creating this PR no merge conflicts were reported from linux-next and no merge conflicts showed up doing a test-merge with current mainline. The following changes since commit 197b6b60ae7bc51dd0814953c562833143b292aa: Linux 6.3-rc4 (2023-03-26 14:40:20 -0700) are available in the Git repository at: ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping.git tags/vfs.misc.fixes.v6.3-rc6 for you to fetch changes up to cb2239c198ad9fbd5aced22cf93e45562da781eb: fs: drop peer group ids under namespace lock (2023-03-31 12:13:37 +0200) Please consider pulling these changes from the signed vfs.misc.fixes.v6.3-rc6 tag. Thanks! Christian ---------------------------------------------------------------- vfs.misc.fixes.v6.3-rc6 ---------------------------------------------------------------- Christian Brauner (1): fs: drop peer group ids under namespace lock fs/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)