Re: [PATCH] fs: open the block device after allocation the super_block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 24, 2023 at 10:51:45AM -0700, Christoph Hellwig wrote:
> From: Jan Kara <jack@xxxxxxx>
> 
> Currently get_tree_bdev and mount_bdev open the block device before
> commiting to allocating a super block.  This means the block device
> is opened even for bind mounts and other reuses of the 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 mount code to first look whether the superblock for a
> particular device is already mounted and open the block device only if
> it is not.
> 
> Signed-off-by: Jan Kara <jack@xxxxxxx>
> [hch: port to before the bdev_handle changes,
>       duplicate the bdev read-only check from blkdev_get_by_path,
>       extend the fsfree_mutex coverage to protect against freezes,
>       fix an open bdev leak when the bdev is frozen,
>       use the bdev local variable more,
>       rename the s variable to sb to be more descriptive]
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
> 
> So I promised to get a series that builds on top of this ready, but
> I'm way to busy and this will take a while.  Getting this reworked
> version of Jan's patch out for everyone to use it as a based given
> that Christian is back from vacation, and I think Jan should be about
> back now as well.

I'm in the middle of reviewing this. You're probably aware, but both
btrfs and nilfs at least still open the devices first since they
open-code their bdev and sb handling.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux