All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] btrfs-progs: add RAID5/6 support to btrfs fi us
@ 2020-05-27 20:37 Goffredo Baroncelli
  2020-05-27 20:37 ` [PATCH] Add support for RAID5/6 to the command "btrfs fi us" Goffredo Baroncelli
  2020-05-28 16:07 ` [PATCH V2] btrfs-progs: add RAID5/6 support to btrfs fi us David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Goffredo Baroncelli @ 2020-05-27 20:37 UTC (permalink / raw)
  To: linux-btrfs; +Cc: DanglingPointer, Joshua Houghton, David Sterba


Hi all,

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.

In order to bypass this issue, I compute these values from the 
r_{data,metadata,system}_chunks values and the ratio
l_*_used / l_*_chunks.

So now if you run btrfs fi us in a raid6 filesystem you get:

$ sudo btrfs fi us / 
Overall:
    Device size:		  40.00GiB
    Device allocated:		   8.28GiB
    Device unallocated:		  31.72GiB
    Device missing:		     0.00B
    Used:			   5.00GiB
    Free (estimated):		  17.36GiB	(min: 17.36GiB)
    Data ratio:			      2.00
    Metadata ratio:		      0.00
    Global reserve:		   3.25MiB	(used: 0.00B)

Data,RAID6: Size:4.00GiB, Used:2.50GiB (62.53%)
[...]

Instead before:

$ sudo btrfs fi us /
WARNING: RAID56 detected, not implemented
WARNING: RAID56 detected, not implemented
WARNING: RAID56 detected, not implemented
Overall:
    Device size:		  40.00GiB
    Device allocated:		     0.00B
    Device unallocated:		  40.00GiB
    Device missing:		     0.00B
    Used:			     0.00B
    Free (estimated):		     0.00B	(min: 8.00EiB)
    Data ratio:			      0.00
    Metadata ratio:		      0.00
    Global reserve:		   3.25MiB	(used: 0.00B)

Data,RAID6: Size:4.00GiB, Used:2.50GiB (62.53%)
[...]


I want to point out that this patch should be compatible with my
previous patches set (the ones related to the new ioctl 
BTRFS_IOC_GET_CHUNK_INFO). If both are merged we will have a 'btrfs fi us'
commands with full support a raid5/6 filesystem without needing root
capability.

I rewrote the patch after some David's comments about the difficult to
review it because I changed too much code. So this time I tried to be less
intrusive. I leaved the old logic and I computed only the missing
values.

Comments are welcome.
BR
G.Baroncelli

V2:
The patch is completely rewritten to be less intrusive

V1:
First issue

-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-28 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 20:37 [PATCH V2] btrfs-progs: add RAID5/6 support to btrfs fi us Goffredo Baroncelli
2020-05-27 20:37 ` [PATCH] Add support for RAID5/6 to the command "btrfs fi us" Goffredo Baroncelli
2020-05-28 16:07 ` [PATCH V2] btrfs-progs: add RAID5/6 support to btrfs fi us David Sterba
2020-05-28 16:46   ` Goffredo Baroncelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.