Thread (46 messages) 46 messages, 9 authors, 2023-10-02

Re: [PATCH 05/17] btrfs: open block devices after superblock creation

From: David Sterba <hidden>
Date: 2023-08-11 13:18:03
Also in: linux-btrfs, linux-fsdevel, linux-s390

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:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help