On Wed, Apr 17, 2024 at 03:43:12PM +0200, Jan Kara wrote: > > fs/btrfs/volumes.c:485: ret = set_blocksize(bdev, BTRFS_BDEV_BLOCKSIZE); > > Some of the callers do not bother with exclusive open; > > in particular, if btrfs_get_dev_args_from_path() ever gets a pathname > > of a mounted device with something other than btrfs on it, it won't > > be pretty. > > Yeah and frankly reading through btrfs_read_dev_super() I'm not sure which > code needs the block size set either. We use read_cache_page_gfp() for the > IO there as well. FWIW, I don't understand the use of invalidate_bdev() in btrfs_get_bdev_and_sb(), especially when called from btrfs_get_dev_args_from_path() - what's the point of evicting page cache before reading the on-disk superblock, when all we are going to do with the data we get is scan through internal list of opened devices for uuid, etc. matches? Could btrfs folks comment on that one?