From: sam tygier <samtygier@yahoo.co.uk>
To: linux-btrfs@vger.kernel.org
Cc: dave@jikos.cz
Subject: [PATCH v3] Btrfs: Check metadata redundancy on balance
Date: Wed, 6 Jan 2016 09:02:31 +0000 [thread overview]
Message-ID: <568CD827.3060601@yahoo.co.uk> (raw)
From: Sam Tygier <samtygier@yahoo.co.uk>
Date: Wed, 6 Jan 2016 08:46:12 +0000
Subject: [PATCH] Btrfs: Check metadata redundancy on balance
When converting a filesystem via balance check that metadata mode
is at least as redundant as the data mode. For example give warning
when:
-dconvert=raid1 -mconvert=single
Signed-off-by: Sam Tygier <samtygier@yahoo.co.uk>
---
v3:
Use btrfs_warn()
Mention profiles in message
v2:
Use btrfs_get_num_tolerated_disk_barrier_failures()
---
fs/btrfs/volumes.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index a23399e..be91458 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3756,6 +3756,14 @@ int btrfs_balance(struct btrfs_balance_control *bctl,
}
} while (read_seqretry(&fs_info->profiles_lock, seq));
+ if (btrfs_get_num_tolerated_disk_barrier_failures(bctl->meta.target) <
+ btrfs_get_num_tolerated_disk_barrier_failures(bctl->data.target)) {
+ btrfs_warn(fs_info,
+ "Warning: metatdata profile %llu has lower redundancy "
+ "than data profile %llu\n", bctl->meta.target,
+ bctl->data.target);
+ }
+
if (bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT) {
fs_info->num_tolerated_disk_barrier_failures = min(
btrfs_calc_num_tolerated_disk_barrier_failures(fs_info),
--
2.4.3
next reply other threads:[~2016-01-06 9:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 9:02 sam tygier [this message]
2016-01-07 13:24 ` [PATCH v3] Btrfs: Check metadata redundancy on balance David Sterba
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=568CD827.3060601@yahoo.co.uk \
--to=samtygier@yahoo.co.uk \
--cc=dave@jikos.cz \
--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 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.