kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
550 stars 241 forks source link

filesystem usage reports (emulated) zone size as 0. #658

Open CorrosiveTruths opened 1 year ago

CorrosiveTruths commented 1 year ago

Hi, running btrfs fi usage / on a zoned device has the line: Device zone size: 0.00B dmesg reports the correct size:

[    2.937292] BTRFS info (device sdf2): regular block device /dev/sdf2, 104 emulated zones of 268435456 bytes
[    2.937300] BTRFS info (device sdf2): zoned mode enabled with zone size 268435456

Tested with git master.

kdave commented 1 year ago

For the fi usage the zone is read from sysfs file, which does not exist for emulated zoned mode, so it needs to be read by another means.