mirror of
https://github.com/kdave/btrfs-progs
synced 2025-03-04 01:37:39 +00:00
btrfs-progs: fi usage: don't reset ratio to 1 if we don't have RAID56 profile
Commit 80714610f3
("btrfs-progs: use raid table for ncopies")
slightly broke how raid ratio are being calculated since the resulting
code would always reset ratio to be 1 in case we didn't have RAID56
profile. The correct behavior is to simply set it to 0 if we have RAID56
as the calculation is different in this case and leave it intact
otherwise.
This bug manifests by doing all size-related calculation for 'btrfs
filesystem usage' command as if all block groups are of type SINGLE. Fix
this by only resetting ratio 0 in case of RAID56.
Issue: #422
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
683f41bfb0
commit
6df189771d
@ -508,8 +508,6 @@ static int print_filesystem_usage_overall(int fd, struct chunk_info *chunkinfo,
|
||||
*/
|
||||
if (flags & BTRFS_BLOCK_GROUP_RAID56_MASK)
|
||||
ratio = 0;
|
||||
else
|
||||
ratio = 1;
|
||||
|
||||
if (ratio > max_data_ratio)
|
||||
max_data_ratio = ratio;
|
||||
|
Loading…
Reference in New Issue
Block a user