All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] btrfs-progs: add warning for mixed profiles filesystem
@ 2020-03-31 19:10 Goffredo Baroncelli
  2020-03-31 19:10 ` [PATCH 1/4] Complete the implementation of RAID1C[34] Goffredo Baroncelli
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Goffredo Baroncelli @ 2020-03-31 19:10 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Zygo Blaxell, Qu Wenruo, David Sterba



Hi all,

the aim of this patch set is to issue a warning when a mixed profiles
filesystem is detected. This happens when the filesystems contains
(i.e.) raid1c3 and single chunk for data.

BTRFS has the capability to support a filesystem with mixed profiles.
However this could lead to an unexpected behavior when a new chunk is
allocated (i.e. the chunk profile is not what is wanted). Moreover
if the user is not aware of this, he could assume a redundancy which
doesn't exist (for example because there is some 'single' chunk when
it is expected the filesystem to be full raid1).
A possible cause of a mixed profiles filesystem is an interrupted
balance operation or a not fully balance due to very specific filter.

The check is added to the following btrfs commands:
- btrfs balance pause
- btrfs balance cancel
- btrfs filesystem usage
- btrfs device add

Suggestion about which commands should (not) have this check are 
welcome.

v1 
- first issue
v2 
- add some needed missing pieces about raid1c[34]
- add the check to more btrfs commands

Example of output:

$ sudo ./btrfs fi us /tmp/t/
WARNING: cannot read detailed chunk info, per-device usage will not be shown, run as root
Overall:
    Device size:		  30.00GiB
    Device allocated:		   7.78GiB
    Device unallocated:		  22.22GiB
    Device missing:		     0.00B
    Used:			   1.94GiB
    Free (estimated):		  11.89GiB	(min: 9.77GiB)
    Data ratio:			      2.33
    Metadata ratio:		      1.50
    Global reserve:		   3.25MiB	(used: 0.00B)

Data,single: Size:1.00GiB, Used:973.87MiB (95.10%)

Data,RAID1C3: Size:2.00GiB, Used:178.98MiB (8.74%)

Metadata,single: Size:256.00MiB, Used:94.69MiB (36.99%)

Metadata,RAID1: Size:256.00MiB, Used:188.45MiB (73.61%)

System,single: Size:32.00MiB, Used:16.00KiB (0.05%)

WARNING: ------------------------------------------------------
WARNING: Detection of multiple profiles for a block group type:
WARNING:
WARNING: * DATA ->          [raid1c3, single]
WARNING: * METADATA ->      [raid1, single]
WARNING:
WARNING: Please consider using 'btrfs balance ...' commands set
WARNING: to solve this issue.
WARNING: ------------------------------------------------------


In this case there are two kind of chunks for data (raid1c3 and single)
and metadata (raid1, single).

Patch #1 and #2 are preparatory ones.
Patch #3 contains the code for the check.
Patch #4 adds the check to the command 'btrfs fi us'

Comments are welcome

BR
G.Baroncelli

-- 
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] 13+ messages in thread
* [RFC][PATCH] btrfs-progs: add warning for mixed prfofiles filesystem
@ 2020-03-25 20:10 Goffredo Baroncelli
  2020-03-25 20:10 ` [PATCH 3/4] btrfs-progs: Add btrfs_check_for_mixed_profiles_by_* function Goffredo Baroncelli
  0 siblings, 1 reply; 13+ messages in thread
From: Goffredo Baroncelli @ 2020-03-25 20:10 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Zygo Blaxell


Hi all,

the aim of this patch set is to issue a warning when a mixed profiles
filesystem is detected. This happens when the filesystems contains
(i.e.) raid1c3 and single chunk for data.

BTRFS has the capability to support a filesystem with mixed profiles.
However this could lead to an unexpected behavior when a new chunk is
allocated (i.e. the chunk profile is not what is wanted). Moreover
if the user is not aware of this, he could assume a redundancy which
doesn't exist (for example because there is some 'single' chunk when
it is expected the filesystem to be full raid1).
A possible cause of a mixed profiles filesystem is an interrupted
balance operation or a not fully balance due to very specific filter.

In this first attempt the check is only added to the 'btrfs fi us'
command. I hope to receive suggestion about which commands should
have this check (I think all the commands which interact with a
mounted filesystem).

Example of output:

$ sudo ./btrfs fi us /tmp/t/
WARNING: ------------------------------------------------------
WARNING: Detection of multiple profiles for a block group type:
WARNING:
WARNING: * DATA ->          [raid1c3, single]
WARNING: * METADATA ->      [raid1, single]
WARNING:
WARNING: Please consider using 'btrfs balance ...' commands set
WARNING: to solve this issue.
WARNING: ------------------------------------------------------
Overall:
    Device size:		  30.00GiB
    Device allocated:		   7.78GiB
    Device unallocated:		  22.22GiB
    Device missing:		     0.00B
    Used:			   1.84GiB
    Free (estimated):		  11.93GiB	(min: 9.82GiB)
    Data ratio:			      2.33
    Metadata ratio:		      1.50
    Global reserve:		   3.25MiB	(used: 0.00B)

Data,single: Size:1.00GiB, Used:1023.91MiB (99.99%)
   /dev/loop0	   1.00GiB

Data,RAID1C3: Size:2.00GiB, Used:128.90MiB (6.29%)
   /dev/loop0	   2.00GiB
   /dev/loop1	   2.00GiB
   /dev/loop2	   2.00GiB

Metadata,single: Size:256.00MiB, Used:88.67MiB (34.64%)
   /dev/loop1	 256.00MiB

Metadata,RAID1: Size:256.00MiB, Used:194.28MiB (75.89%)
   /dev/loop1	 256.00MiB
   /dev/loop2	 256.00MiB

System,single: Size:32.00MiB, Used:16.00KiB (0.05%)
   /dev/loop2	  32.00MiB

Unallocated:
   /dev/loop0	   7.00GiB
   /dev/loop1	   7.50GiB
   /dev/loop2	   7.72GiB


In this case there are two kind of chunks for data (raid1c3 and single)
and metadata (raid1, single).

Patch #1 and #2 are preparatory ones.
Patch #3 contains the code for the check.
Patch #4 adds the check to the command 'btrfs fi us'

Comments are welcome

BR
G.Baroncelli

-- 
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] 13+ messages in thread

end of thread, other threads:[~2020-04-01 19:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 19:10 [PATCH v2] btrfs-progs: add warning for mixed profiles filesystem Goffredo Baroncelli
2020-03-31 19:10 ` [PATCH 1/4] Complete the implementation of RAID1C[34] Goffredo Baroncelli
2020-03-31 19:10 ` [PATCH 2/4] btrfs-progs: Add BTRFS_EXTENDED_PROFILE_MASK mask Goffredo Baroncelli
2020-03-31 19:10 ` [PATCH 3/4] btrfs-progs: Add btrfs_check_for_mixed_profiles_by_* function Goffredo Baroncelli
2020-03-31 19:10 ` [PATCH 4/4] btrfs-progs: Add mixed profiles check to some btrfs sub-commands Goffredo Baroncelli
2020-03-31 21:46 ` [PATCH v2] btrfs-progs: add warning for mixed profiles filesystem Graham Cobb
2020-03-31 22:05   ` Zygo Blaxell
2020-04-01 10:58     ` Graham Cobb
2020-04-01 17:15     ` Goffredo Baroncelli
2020-04-01 18:20       ` David Sterba
2020-04-01 19:05         ` Goffredo Baroncelli
2020-04-01 18:25 ` David Sterba
  -- strict thread matches above, loose matches on Subject: below --
2020-03-25 20:10 [RFC][PATCH] btrfs-progs: add warning for mixed prfofiles filesystem Goffredo Baroncelli
2020-03-25 20:10 ` [PATCH 3/4] btrfs-progs: Add btrfs_check_for_mixed_profiles_by_* function 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.