mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-17 20:05:24 +00:00
1b194bb620
Current formula calculates the stripe size, however that's not what we want in the case of RAID1/DUP profiles. In those cases since chunk are mirrored across devices we want the full size of the chunk. Without this patch the 'btrfs fi usage' output from an fs which is using RAID1 is: Data,RAID1: Size:2.00GiB, Used:1.00GiB (50.03%) /dev/vdc 1.00GiB /dev/vdf 1.00GiB Metadata,RAID1: Size:256.00MiB, Used:1.34MiB (0.52%) /dev/vdc 128.00MiB /dev/vdf 128.00MiB System,RAID1: Size:8.00MiB, Used:16.00KiB (0.20%) /dev/vdc 4.00MiB /dev/vdf 4.00MiB Unallocated: /dev/vdc 8.87GiB /dev/vdf 8.87GiB So a 2 gigabyte RAID1 chunk actually will take up 4 gigabytes on the actual disks 2 each. In this case this is being miscalculated as taking up 1GiB on each device. This also leads to erroneously calculated unallocated space. The correct output in this case is: Data,RAID1: Size:2.00GiB, Used:1.00GiB (50.03%) /dev/vdc 2.00GiB /dev/vdf 2.00GiB Metadata,RAID1: Size:256.00MiB, Used:1.34MiB (0.52%) /dev/vdc 256.00MiB /dev/vdf 256.00MiB System,RAID1: Size:8.00MiB, Used:16.00KiB (0.20%) /dev/vdc 8.00MiB /dev/vdf 8.00MiB Unallocated: /dev/vdc 7.74GiB /dev/vdf 7.74GiB Fix it by only utilising the chunk formula for profiles which are not RAID1/DUP. Issue: #422 Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
balance.c | ||
commands.h | ||
device.c | ||
filesystem-du.c | ||
filesystem-usage.c | ||
filesystem-usage.h | ||
filesystem.c | ||
inspect-dump-super.c | ||
inspect-dump-tree.c | ||
inspect-tree-stats.c | ||
inspect.c | ||
property.c | ||
props.h | ||
qgroup.c | ||
qgroup.h | ||
quota.c | ||
receive-dump.c | ||
receive-dump.h | ||
receive.c | ||
replace.c | ||
rescue-chunk-recover.c | ||
rescue-super-recover.c | ||
rescue.c | ||
rescue.h | ||
restore.c | ||
scrub.c | ||
send.c | ||
subvolume-list.c | ||
subvolume.c |