Open
Description
Hi,
I'm forwarding Debian Bug #1069744, and I confirm its presence in btrfs-progs 6.12.
Btrfs-progs returns wrong Device size, Device slack, and Unallocated device usage as a normal user. I agree with Russell Coker's claim that this is wrong and misleading output, and I agree that it would better if btrfs-progs exited with an error and an error message that "this functionality requires CAP_ADMIN", or insufficient permissions, or root/superuser/etc.
As root:
# btrfs device usage /
/dev/mapper/cryptvol, ID: 1
Device size: 97.34GiB
Device slack: 0.00B
Data,single: 90.03GiB
Metadata,single: 2.01GiB
System,single: 4.00MiB
Unallocated: 5.30GiB
As a normal user:
$ btrfs device usage /
WARNING: cannot read detailed chunk info, per-device usage will not be shown, run as root
/dev/mapper/cryptvol, ID: 1
Device size: 194.68MiB
Device slack: 16.00EiB
Unallocated: N/A