Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1211809rwb; Sat, 5 Aug 2023 09:26:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHylwbDYs35Z90HIjatcgK+O2gqe9C5jp+DqplDbfWj1wgjJ50gbSLQbytMAGQem+kfCpPo X-Received: by 2002:a05:6a00:1515:b0:675:70d7:1eb4 with SMTP id q21-20020a056a00151500b0067570d71eb4mr3993191pfu.14.1691252816805; Sat, 05 Aug 2023 09:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691252816; cv=none; d=google.com; s=arc-20160816; b=yc93sP0eDR9ZuUOcNNJcdtpEkI8+5g7EEfNMone8wPV2lQyN9VzRNY9UcG3dghcSnb ErJNBuYmjs8Iijp72wee/iQezxNHdF4m6rmuFHBpmpi/wJXOfRZK8TI8EyPO7QyTdENi xfKrMi+/GzT+BGMwT/i90tAb662vNzyR1aX53uuen40UUoK96SBWi/K5DvPcybz9+XHN Ly9bXOwFWLwDOYMzeLK9diSz2lmHWFPmEF4fPXh56B/BKbedDPk7wE4qTWXmz1Rbc1Mk 3Q8CyP1GbqAIfJAQtiMQJ9TfZiVaLQAyb9buV91wwTpRiU4huhNTvniCufLcRKrK4q40 sEBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yjNsJCLVAu0TU0e6K2MCvm9mrzrNe+dQtFIPEgONaU4=; fh=x/YWOk/H1gK2M7rG7DzCw7KZxNf5q01TAKGp21Td7Vw=; b=ouVG4C1mDM4BV3aTAS9w3ME6ZhQcdtFUjodWOZnPydMqSyCNNGuTkm8hQKWwzWW4Uq JaL9uxJSG2hco/8KzlW4sHU4SqtdFsckuJB8zNvjuPtJt6RTJ0UYTjb3na0bOAgRvUDh SupIPg2LF0W5YoSyRgLyWq3xaFHhCw9b17K3ALR9q7XHDvjFi+jteKTrJWklzYuVPE/d FAN0D/OV7UpbKhkfW5xSrU/O2zZcbJkQkb9q97POLgLS/aSlRQova33pyDUczUO+xM3n jsn5k2pnP9Hxim8h2DfMvI6koMv3qfa4ZvnSTcjEATCr2seOnqOTBdsR8/bqtiUIA5y6 JniA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Z0h/IrNV"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be9-20020a056a001f0900b006866be8eed2si3267404pfb.137.2023.08.05.09.26.13; Sat, 05 Aug 2023 09:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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="Z0h/IrNV"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S229618AbjHEQTI (ORCPT + 99 others); Sat, 5 Aug 2023 12:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjHEQTH (ORCPT ); Sat, 5 Aug 2023 12:19:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B1A910F8; Sat, 5 Aug 2023 09:19:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E366960C08; Sat, 5 Aug 2023 16:19:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F45DC433C8; Sat, 5 Aug 2023 16:19:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691252345; bh=eczxg65nAKdspBAZJjvsqnJ9aD9e1Cnh1ASqk/5x4Tc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z0h/IrNV9FDvUWv2eNzdGVI/pdKwMLXK4ephLjq8qasptg9QR42I18oxpmAO8umTF +jPDQ/hHlUXz8vlybFxoV5RemFk0DVSLbmOMRAK0CJqcO8LUXtppZEHOBIInbCw1Bp JTrajwX0bDnORyljOsGHdnXOxmx4UhQ4gFvfINhcXD8pnn5ERuxQv6rcgrEHwNJK1I cw8urElSBCWxmfql/5enH6QJ/LQEtkXgzdIYOACoSdLpWEdSHCXQJS6+TIJwCyfYu7 hRiEBFxuNr7P2y5wMX51/z0/iaXoTcxnlDluglqILaNhlVU/0TaObzI32WdPQIaxv2 RPO/N8LaaV66Q== Date: Sat, 5 Aug 2023 09:19:04 -0700 From: "Darrick J. Wong" To: Christoph Hellwig Cc: Al Viro , Christian Brauner , Jan Kara , Chris Mason , Josef Bacik , David Sterba , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Ryusuke Konishi , Jens Axboe , linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 11/12] xfs: drop s_umount over opening the log and RT devices Message-ID: <20230805161904.GM11377@frogsfrogsfrogs> References: <20230802154131.2221419-1-hch@lst.de> <20230802154131.2221419-12-hch@lst.de> <20230802163219.GW11352@frogsfrogsfrogs> <20230805083239.GA29780@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230805083239.GA29780@lst.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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-ext4@vger.kernel.org On Sat, Aug 05, 2023 at 10:32:39AM +0200, Christoph Hellwig wrote: > On Wed, Aug 02, 2023 at 09:32:19AM -0700, Darrick J. Wong wrote: > > > + /* see get_tree_bdev why this is needed and safe */ > > > > Which part of get_tree_bdev? Is it this? > > > > /* > > * s_umount nests inside open_mutex during > > * __invalidate_device(). blkdev_put() acquires > > * open_mutex and can't be called under s_umount. Drop > > * s_umount temporarily. This is safe as we're > > * holding an active reference. > > */ > > up_write(&s->s_umount); > > blkdev_put(bdev, fc->fs_type); > > down_write(&s->s_umount); > > Yes. With the refactoring earlier in the series get_tree_bdev should > be trivial enough to not need a more specific reference. If you > think there's a better way to refer to it I can update the comment, > though. How about: /* * blkdev_put can't be called under s_umount, see the comment in * get_tree_bdev for more details */ with that and the label name change, Reviewed-by: Darrick J. Wong --D > > > mp->m_logdev_targp = mp->m_ddev_targp; > > > } > > > > > > - return 0; > > > + error = 0; > > > +out_unlock: > > > + down_write(&sb->s_umount); > > > > Isn't down_write taking s_umount? I think the label should be > > out_relock or something less misleading. > > Agreed. Christian, can you just change this in your branch, or should > I send an incremental patch? >