linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: linux-btrfs@vger.kernel.org
Cc: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Subject: [RFC][PATCH] btrfs-progs: add warning for mixed prfofiles filesystem
Date: Wed, 25 Mar 2020 21:10:38 +0100	[thread overview]
Message-ID: <20200325201042.190332-1-kreijack@libero.it> (raw)


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


             reply	other threads:[~2020-03-25 20:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 20:10 Goffredo Baroncelli [this message]
2020-03-25 20:10 ` [PATCH 1/4] btrfs-progs: Add missing fields to btrfs_raid_array[] for raid1c[34] Goffredo Baroncelli
2020-03-26  1:59   ` Qu Wenruo
2020-03-26 17:28     ` Goffredo Baroncelli
2020-03-25 20:10 ` [PATCH 2/4] btrfs-progs: Add BTRFS_EXTENDED_PROFILE_MASK mask Goffredo Baroncelli
2020-03-25 20:10 ` [PATCH 3/4] btrfs-progs: Add btrfs_check_for_mixed_profiles_by_* function Goffredo Baroncelli
2020-03-25 20:10 ` [PATCH 4/4] btrfs-progs: Add mixed profiles check to 'btrfs fi us' Goffredo Baroncelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200325201042.190332-1-kreijack@libero.it \
    --to=kreijack@libero.it \
    --cc=ce3g8jdj@umail.furryterror.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).