On Wed, Mar 05, 2025 at 02:15:47PM +0000, Matthew Wilcox wrote: > On Tue, Mar 04, 2025 at 10:33:30PM -0800, Darrick J. Wong wrote: > > > So this is expedient because XFS happens to not call sb_set_blocksize()? > > > What is the path forward for filesystems which call sb_set_blocksize() > > > today and want to support LBS in future? > > > > Well they /could/ set sb_blocksize/sb_blocksize_bits themselves, like > > XFS does. > > I'm kind of hoping that isn't the answer. set_blocksize() can be used. The only extra steps the filesystem needs to in addition is: sb->s_blocksize = size; sb->s_blocksize_bits = blksize_bits(size); Which is what both XFS and bcachefs do. We could modify sb to add an LBS flag but that alone would not suffice either as the upper limit is still a filesystem specific limit. Additionally it also does not suffice for filesystems that support a different device for metadata writes, for instance XFS supports this and uses the sector size for set_blocksize(). So I think that if ext4 for example wants to use LBS then simply it would open code the above two lines and use set_blocksize(). Let me know if you have any other recommendations. Luis