Re: [PATCH 0/2] btrfs-progs: allowing 2K block size for experimental builds

David Sterba
2025-03-19T21:49:19Z

On Wed, Feb 26, 2025 at 02:29:13PM +1030, Qu Wenruo wrote:
> Btrfs always has its minimal block size as 4K, but that means on the
> most common architecture, x86_64, we can not utilize the subpage block
> size routine at all.
>
> Although the future larger folios support will allow us to utilize
> subpage routines, the support is still not yet there.
>
> On the other hand, lowering the block size for experimental/debug builds is
> much easier, there is only one major bug (fixed by the first patch) in
> btrfs-progs at least.
>
> Kernel sides enablement is not huge either, but it has dependency on
> the subpage related backlog patches to pass most fstests, which is not small.
>
> However since we're not pushing this 2K block size for end users, we can
> accept some limitations on the 2K block size support:
>
> - No 2K node size mkfs support
> This is mostly caused by how we create the initial temporaray fs.
> The initial temporaray fs contains at least 6 root items.
> But one root item is 439 bytes, we need a level 1 root tree for the
> initial temporaray fs.
>
> But we do not support multi-level trees for the initial fs, thus no
> such support for now.
>
> - No mixed block groups mkfs support
> Caused by the missing 2K node size support
>
> Qu Wenruo (3):
> btrfs-progs: fix the incorrect buffer size for super block
> btrfs-progs: support 2k block size
> btrfs-progs: convert: check the sectorsize against BTRFS_MIN_BLOCKSIZE

Thanks, added to devel. I've enabled the 2k case for convert but it
fails, I haven't analyzed it as it does not seem to be important right
now.