Re: [PATCH RFC 2/8] fs: add a global device to super block hash table
Christian Brauner <[email protected]>
| Newsgroups | org.ozlabs.lists.linux-erofs,org.kernel.vger.linux-block,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-xfs |
|---|---|
| Message-ID | <20260616-fragil-duktus-nachverfolgen-60f54584c206@brauner> |
On Tue, Jun 16, 2026 at 02:34:43PM +0200, Christoph Hellwig wrote: > On Tue, Jun 02, 2026 at 12:10:08PM +0200, Christian Brauner wrote: > > fs_holder_ops recovers the owning superblock from bdev->bd_holder, which > > forces the holder to be exactly one superblock and prevents several > > superblocks from sharing one block device. That's what erofs is doing. > > > > Introduce a global dev_t-keyed rhltable mapping each block device to the > > superblock(s) using it. The holder argument becomes purely the block > > layer's exclusivity token (a superblock, or a file_system_type for > > shared devices) and is no longer needed by the fs specific callbacks. > > Err, no. block devices need to have a specific owner. If erofs wants > to share a device between superblock it needs to come up with an entity > that owns the block devices which is not a superblock. It already did. > IMHO sharing devices between superblocks is a bad idea, but that ship > has sailed, but please keep it contained inside of erofs. We need a simple device number to superblock mapping anyway and that can simply be centralized in the vfs. And it can work with anon device numbers and block device numbers uniformly.