|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
From 349ea14a32ab63555cff47440f178ed01870e3f6 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
From: Neal Gompa <ngompa@centosproject.org>
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
Date: Wed, 1 Sep 2021 19:25:55 -0400
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
Subject: [PATCH] balance, mkfs: Disable raid56 modes
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
The RAID 5/6 modes in Btrfs are not yet suitable for production use,
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
so it is disabled.
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
Signed-off-by: Neal Gompa <ngompa@centosproject.org>
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
---
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
cmds/balance.c | 35 ++++-------------------------------
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
mkfs/main.c | 4 ++--
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
2 files changed, 6 insertions(+), 33 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
diff --git a/cmds/balance.c b/cmds/balance.c
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
index 7abc69d9..ab86ff36 100644
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
--- a/cmds/balance.c
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
+++ b/cmds/balance.c
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
@@ -376,8 +376,7 @@ static const char * const cmd_balance_start_usage[] = {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
"-d[filters] act on data chunks",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
"-m[filters] act on metadata chunks",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
"-s[filters] act on system chunks (only under -f)",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- "-f force a reduction of metadata integrity, or",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- " skip timeout when converting to RAID56 profiles",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
+ "-f force a reduction of metadata integrity",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
"--full-balance do not print warning and do not delay start",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
"--background|--bg",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
" run the balance as a background process",
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
@@ -400,7 +399,6 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
int background = 0;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
bool enqueue = false;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
unsigned start_flags = 0;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- bool raid56_warned = false;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
int i;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
memset(&args, 0, sizeof(args));
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
@@ -507,8 +505,6 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
/* soft makes sense only when convert for corresponding type is set */
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
for (i = 0; ptrs[i]; i++) {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
- int delay = 10;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
-
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
if ((ptrs[i]->flags & BTRFS_BALANCE_ARGS_SOFT) &&
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
!(ptrs[i]->flags & BTRFS_BALANCE_ARGS_CONVERT)) {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
error("'soft' option can be used only when converting profiles");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
@@ -518,33 +514,10 @@ static int cmd_balance_start(const struct cmd_struct *cmd,
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
if (!(ptrs[i]->flags & BTRFS_BALANCE_ARGS_CONVERT))
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
continue;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
- if (!(ptrs[i]->target & BTRFS_BLOCK_GROUP_RAID56_MASK))
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
-
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- if (raid56_warned)
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
-
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- raid56_warned = true;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("WARNING:\n\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("\tRAID5/6 support has known problems and is strongly discouraged\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("\tto be used besides testing or evaluation. It is recommended that\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("\tyou use one of the other RAID profiles.\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- /*
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- * Override timeout by the --force option too, though it's
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- * otherwise used for allowing redundancy reduction.
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- */
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- if (force) {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("\tSafety timeout skipped due to --force\n\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- }
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("\tThe operation will continue in %d seconds.\n", delay);
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("\tUse Ctrl-C to stop.\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- while (delay) {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("%2d", delay--);
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- fflush(stdout);
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- sleep(1);
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
+ if (ptrs[i]->target & BTRFS_BLOCK_GROUP_RAID56_MASK) {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
+ error("RAID5/6 support has known problems and is disabled.");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
+ return 1;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
}
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- printf("\nStarting conversion to RAID5/6.\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
}
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
if (!(start_flags & BALANCE_START_FILTERS) && !(start_flags & BALANCE_START_NOWARN)) {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
diff --git a/mkfs/main.c b/mkfs/main.c
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
index 4d50bd25..5f66e6ae 100644
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
--- a/mkfs/main.c
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
+++ b/mkfs/main.c
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
@@ -1176,8 +1176,8 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
ae2607 |
if ((data_profile | metadata_profile) & BTRFS_BLOCK_GROUP_RAID56_MASK) {
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
features |= BTRFS_FEATURE_INCOMPAT_RAID56;
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- warning("RAID5/6 support has known problems is strongly discouraged\n"
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
- "\t to be used besides testing or evaluation.\n");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
23e2ef |
+ error("RAID5/6 support has known problems and is disabled.");
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
+ exit(1);
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
}
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
if ((data_profile | metadata_profile) &
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
--
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
2.31.1
|
|
![](https://seccdn.libravatar.org/avatar/78eb5545c77d95a891c05cb362dfc4525c92e5398a7645c5bd23e126784d44a9?s=16&d=retro) |
71c8ec |
|