Re: [PATCH 05/17] btrfs: open block devices after superblock creation
- To: Christian Brauner <brauner@kernel.org>
- Cc: Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>, Jens Axboe <axboe@kernel.dk>, Denis Efremov <efremov@linux.com>, Josef Bacik <josef@toxicpanda.com>, Stefan Haberland <sth@linux.ibm.com>, Jan Hoeppner <hoeppner@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, "Darrick J . Wong" <djwong@kernel.org>, Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>, linux-block@vger.kernel.org, nbd@other.debian.org, linux-s390@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
- Subject: Re: [PATCH 05/17] btrfs: open block devices after superblock creation
- From: David Sterba <dsterba@suse.cz>
- Date: Fri, 11 Aug 2023 15:11:31 +0200
- Message-id: <[🔎] 20230811131131.GN2420@suse.cz>
- Reply-to: dsterba@suse.cz
- In-reply-to: <[🔎] 20230811-wildpark-bronzen-5e30a56de1a1@brauner>
- References: <[🔎] 20230811100828.1897174-1-hch@lst.de> <[🔎] 20230811100828.1897174-6-hch@lst.de> <[🔎] 20230811-wildpark-bronzen-5e30a56de1a1@brauner>
On Fri, Aug 11, 2023 at 02:44:50PM +0200, Christian Brauner wrote:
> On Fri, Aug 11, 2023 at 12:08:16PM +0200, Christoph Hellwig wrote:
> > Currently btrfs_mount_root opens the block devices before committing to
> > allocating a super block. That creates problems for restricting the
> > number of writers to a device, and also leads to a unusual and not very
> > helpful holder (the fs_type).
> >
> > Reorganize the code to first check whether the superblock for a
> > particular fsid does already exist and open the block devices only if it
> > doesn't, mirroring the recent changes to the VFS mount helpers. To do
> > this the increment of the in_use counter moves out of btrfs_open_devices
> > and into the only caller in btrfs_mount_root so that it happens before
> > dropping uuid_mutex around the call to sget.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
>
> Looks good to me,
> Acked-by: Christian Brauner <brauner@kernel.org>
>
> And ofc, would be great to get btrfs reviews.
I'll take a look but there are some performance regressions to deal with
and pre-merge window freeze so it won't be soon.
Reply to: