Skip to content

"wrong and misleading" device usage output as normal user #979

Open
@sten0

Description

@sten0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    UI/UXUser interface changebug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions