From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Darrick J. Wong" Subject: Re: [PATCH 11/12] xfs: drop s_umount over opening the log and RT devices Date: Sat, 5 Aug 2023 09:19:04 -0700 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 Return-path: 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== Content-Disposition: inline In-Reply-To: <20230805083239.GA29780@lst.de> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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? >