Closed oxalica closed 4 weeks ago
Looks like a bug in btrfs-progs' support for zoned devices.
I'll take a look and fix it soon.
For mkfs.btrfs failure to create block group tree, it's a plain pwrite()
which is not zoned compatible due to memory alignment. (In fact, btrfs metadata would never be aligned to sector size of the zoned device).
For btrfstune failure, it's related to the open()
flags, as we need O_DIRECT
to properly imply we're doing zoned operations, so that chunk tree can be properly read using zoned compatible helpers.
Both small fixes, would add test cases for both.
Closing since it's fixed in v6.8.1 already.
In btrfs documentation's "Zoned mode" section, Block group tree is listed as "supported". I read it as "compatible". But currently
mkfs.btrfs
orbtrfstune
cannot enable/convert block-group-tree on zoned devices. Is that btrfs-progs does not implement this feature yet, or are there some hidden issues preventing this operation?My environment:
To reproduce, first setup nullb emulated block device with 256MiB zones, 10GiB size, 4KiB block size: (this script is copied from https://lwn.net/Articles/836726/)
Then
sudo mkfs.btrfs /dev/nullb0 -O block-group-tree,zoned
will return errors:mkfs
thenbtrfstune
also fails:In either case,
dmesg
shows nothing exceptnull_blk
module loading and device creation.