btrfs-progs: fi-usage: fix RAID10 raw disk usage
In case of RAID10, fi usage is reporting half the amount of allocated space and twice the amount of unallocated disk space. Let's fix this. For example, a RAID10 chunk of 3GiB with num_stripes 6, half of the stripes (dev extents) are a mirror of the other half, so the 3GiB of actual data has to be divided by 3, and not 6 to get the size of each of those device extents. Signed-off-by: Hans van Kranenburg <hans@knorrie.org> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
9ff39d48aa
commit
96af160a01
|
@ -660,7 +660,7 @@ static u64 calc_chunk_size(struct chunk_info *ci)
|
|||
else if (ci->type & BTRFS_BLOCK_GROUP_RAID6)
|
||||
return ci->size / (ci->num_stripes -2);
|
||||
else if (ci->type & BTRFS_BLOCK_GROUP_RAID10)
|
||||
return ci->size / ci->num_stripes;
|
||||
return ci->size / (ci->num_stripes / 2);
|
||||
return ci->size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue