Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3566543rdb; Wed, 13 Sep 2023 16:40:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEScBG4ub9hO8sStnknDXSG8mZpTqrt84N29kj2e7AlVvyZ3e17NYCOD7/+/Qx9Yjpulkt4 X-Received: by 2002:a05:6a20:7485:b0:13d:7f7b:1926 with SMTP id p5-20020a056a20748500b0013d7f7b1926mr344119pzd.11.1694648433357; Wed, 13 Sep 2023 16:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694648433; cv=none; d=google.com; s=arc-20160816; b=rqa/1gVjgPCw32dAxepD57ql76vsXPjbNpCrcdV3wV9b5/CGDVZNK0iEX14MvUw4W/ W9B3JsC6Gd1c9xpDr8bpuBgEDtqkNsvCB6fPDxx0Cf+wZ7TyGuXTsebGksj/3k79k0Cb zgvEoxioyFWVpbyDHLdLkgZZUSPCPHG+TYTvtdwPiw07GbVrS+7muk8rTQ/Tx5hTI3RR zhg7Fa4242Ybi01ZbaMUaIm0cpvXy+lnLwsfaRQGHV063fKYaVYuk1DRvh48YkSS2B0x OyZjwlxJS3esGS7huvGGwEEeani6QkP7ycNl+S7tY3myhMwhxlYfu7ihJcMefEPpVKWg WLGg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xklao4KHcROHR/8WDTUTeOE5QrsYvb1TOynYxxAM1IY=; fh=BKhaubn3NgfOFdJuURkVVw5laQp2qzBZJf/ffKnJtu8=; b=bJmBg28xNY4Y1w2dpbsTtovZbZnLMBZye+6OSC4CedC4s5n3jR1ra07wKJT/Skh4/R UZrbeEM1wnNhXb8hCtiOq6OkY+dgiA9x26V+PLGN66ffkeWvtrKZb9i1ALB/XMh72fka wXLtFpKlGfW3YchyzRIuDuA2pogxQvZuOz9iXf64fOhlsfKXr9dk4BE0sesV/FT3mIl2 A9mX2BEuU6RLsC1oFSbxTzZyLMQwUTZJFH8Ojd9Nqcpp/ElMXEBc/N1ywYumG8wsVYuE fCXdA1q6YtG75Oz5Bu9nLr8mA+9lRv9S9ftILWZGrQhklsq2bhZVK84D5h2zaRWpVMc9 9p2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="0av/5m71"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p26-20020a63741a000000b005653e3f6d58si190931pgc.748.2023.09.13.16.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 16:40:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="0av/5m71"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A4A9081D6A8A; Wed, 13 Sep 2023 04:11:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240075AbjIMLLN (ORCPT + 99 others); Wed, 13 Sep 2023 07:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239924AbjIMLLJ (ORCPT ); Wed, 13 Sep 2023 07:11:09 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F5491BC3; Wed, 13 Sep 2023 04:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Xklao4KHcROHR/8WDTUTeOE5QrsYvb1TOynYxxAM1IY=; b=0av/5m717cplc+QOcwl88ZZhkv YQM9yzvQDx1wwNM1F4FN/+TZdcZakCPUB9tpX7qIKXviEYJGNiKL7nM6wzdoFpXYUwE8dRlxYP85n AheRdG3C68ZFMu0glT+SSrQiXRTWdZz1OA6HzM3aCxLykdLie2/UAUNYXAUOU8LULnl7dF85H1y3I bfHoOdc64/KYRLDOL+/ElcKMIOyRVN8LF7dTQpsazJCGbzefGXOUpSfMlN8KQMxT5w6XrbKzELime Ut1U2f7WzU7RHmh/n7g+ZCkfXpAq547wD8l7r+0tUECJw5acUGSocQEMGdzdnjGO/bAAnIc7s4T9b hrVh7h5Q==; Received: from [190.210.221.22] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qgNli-005hzf-03; Wed, 13 Sep 2023 11:10:50 +0000 From: Christoph Hellwig To: Christian Brauner , Al Viro Cc: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Fenghua Yu , Reinette Chatre , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dennis Dalessandro , Tejun Heo , Trond Myklebust , Anna Schumaker , Kees Cook , Damien Le Moal , Naohiro Aota , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org, linux-hardening@vger.kernel.org, cgroups@vger.kernel.org Subject: [PATCH 08/19] pstore: shrink the pstore_sb_lock critical section in pstore_kill_sb Date: Wed, 13 Sep 2023 08:10:02 -0300 Message-Id: <20230913111013.77623-9-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230913111013.77623-1-hch@lst.de> References: <20230913111013.77623-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 04:11:23 -0700 (PDT) ->kill_sb can't race with creating ->fill_super because pstore is a _single file system that only ever has a single sb instance, and we wait for the previous one to go away before creating a new one. Reduce the critical section so that is is not held over generic_shutdown_super. Signed-off-by: Christoph Hellwig --- fs/pstore/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 585360706b335f..fd1d24b47160d0 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -467,10 +467,9 @@ static struct dentry *pstore_mount(struct file_system_type *fs_type, static void pstore_kill_sb(struct super_block *sb) { - mutex_lock(&pstore_sb_lock); - WARN_ON(pstore_sb && pstore_sb != sb); - kill_litter_super(sb); + + mutex_lock(&pstore_sb_lock); pstore_sb = NULL; mutex_lock(&records_list_lock); -- 2.39.2