On Wed, Mar 18, 2020 at 10:11:56PM +0100, Goffredo Baroncelli wrote:
> this patch adds support for the raid5/6 profiles in the command
> 'btrfs filesystem usage'.
>
> Until now the problem was that the value r_{data,metadata}_used is not
> easy to get for a RAID5/6, because it depends by the number of disks.
> And in a filesystem it is possible to have several raid5/6 chunks with a
> different number of disks.
I'd like to get the raid56 'fi du' fixed but the way you implement it
seems to be a too big leap. I've tried to review this patch several
times but always got the impression that reworking the calculations to
make it work for some profiles will most likely break something else. It
has happened in the past.
So, let's start with the case where the filesystem does not have
multiple profiles per block group type, eg. just raid5 for data and
calculate that.
If this also covers the raid56 case with different stripe counts, then
good but as this is special case I won't mind addressing it separately.
The general case of multiple profiles per type is probably an
intermediate state of converting profiles, we can return something sane
if possible or warn as what we have now.
I'm fine if you say you're not going to implement that.