From 5620eb8a1aeca9f95d6b9f55c9a5b8c845b1d482 Mon Sep 17 00:00:00 2001 From: Peter Georg Date: Jan 24 2022 16:44:02 +0000 Subject: Disable RAID5/6 The RAID 5/6 modes in Btrfs are not yet suitable for production use, so it is disabled. --- diff --git a/SOURCES/1001-balance-mkfs-Disable-raid56-modes.patch b/SOURCES/1001-balance-mkfs-Disable-raid56-modes.patch new file mode 100644 index 0000000..fd11f19 --- /dev/null +++ b/SOURCES/1001-balance-mkfs-Disable-raid56-modes.patch @@ -0,0 +1,100 @@ +From 349ea14a32ab63555cff47440f178ed01870e3f6 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 1 Sep 2021 19:25:55 -0400 +Subject: [PATCH] balance, mkfs: Disable raid56 modes + +The RAID 5/6 modes in Btrfs are not yet suitable for production use, +so it is disabled. + +Signed-off-by: Neal Gompa +--- + cmds/balance.c | 35 ++++------------------------------- + mkfs/main.c | 4 ++-- + 2 files changed, 6 insertions(+), 33 deletions(-) + +diff --git a/cmds/balance.c b/cmds/balance.c +index 7abc69d9..ab86ff36 100644 +--- a/cmds/balance.c ++++ b/cmds/balance.c +@@ -376,8 +376,7 @@ static const char * const cmd_balance_start_usage[] = { + "-d[filters] act on data chunks", + "-m[filters] act on metadata chunks", + "-s[filters] act on system chunks (only under -f)", +- "-f force a reduction of metadata integrity, or", +- " skip timeout when converting to RAID56 profiles", ++ "-f force a reduction of metadata integrity", + "--full-balance do not print warning and do not delay start", + "--background|--bg", + " run the balance as a background process", +@@ -400,7 +399,6 @@ static int cmd_balance_start(const struct cmd_struct *cmd, + int background = 0; + bool enqueue = false; + unsigned start_flags = 0; +- bool raid56_warned = false; + int i; + + memset(&args, 0, sizeof(args)); +@@ -507,8 +505,6 @@ static int cmd_balance_start(const struct cmd_struct *cmd, + + /* soft makes sense only when convert for corresponding type is set */ + for (i = 0; ptrs[i]; i++) { +- int delay = 10; +- + if ((ptrs[i]->flags & BTRFS_BALANCE_ARGS_SOFT) && + !(ptrs[i]->flags & BTRFS_BALANCE_ARGS_CONVERT)) { + error("'soft' option can be used only when converting profiles"); +@@ -518,33 +514,10 @@ static int cmd_balance_start(const struct cmd_struct *cmd, + if (!(ptrs[i]->flags & BTRFS_BALANCE_ARGS_CONVERT)) + continue; + +- if (!(ptrs[i]->target & BTRFS_BLOCK_GROUP_RAID56_MASK)) +- continue; +- +- if (raid56_warned) +- continue; +- +- raid56_warned = true; +- printf("WARNING:\n\n"); +- printf("\tRAID5/6 support has known problems and is strongly discouraged\n"); +- printf("\tto be used besides testing or evaluation. It is recommended that\n"); +- printf("\tyou use one of the other RAID profiles.\n"); +- /* +- * Override timeout by the --force option too, though it's +- * otherwise used for allowing redundancy reduction. +- */ +- if (force) { +- printf("\tSafety timeout skipped due to --force\n\n"); +- continue; +- } +- printf("\tThe operation will continue in %d seconds.\n", delay); +- printf("\tUse Ctrl-C to stop.\n"); +- while (delay) { +- printf("%2d", delay--); +- fflush(stdout); +- sleep(1); ++ if (ptrs[i]->target & BTRFS_BLOCK_GROUP_RAID56_MASK) { ++ error("RAID5/6 support has known problems and is disabled."); ++ return 1; + } +- printf("\nStarting conversion to RAID5/6.\n"); + } + + if (!(start_flags & BALANCE_START_FILTERS) && !(start_flags & BALANCE_START_NOWARN)) { +diff --git a/mkfs/main.c b/mkfs/main.c +index 4d50bd25..5f66e6ae 100644 +--- a/mkfs/main.c ++++ b/mkfs/main.c +@@ -1176,8 +1176,8 @@ int BOX_MAIN(mkfs)(int argc, char **argv) + + if ((data_profile | metadata_profile) & BTRFS_BLOCK_GROUP_RAID56_MASK) { + features |= BTRFS_FEATURE_INCOMPAT_RAID56; +- warning("RAID5/6 support has known problems is strongly discouraged\n" +- "\t to be used besides testing or evaluation.\n"); ++ error("RAID5/6 support has known problems and is disabled."); ++ exit(1); + } + + if ((data_profile | metadata_profile) & +-- +2.31.1 + diff --git a/SPECS/btrfs-progs.spec b/SPECS/btrfs-progs.spec index 5d61ec5..08c53d4 100644 --- a/SPECS/btrfs-progs.spec +++ b/SPECS/btrfs-progs.spec @@ -12,6 +12,8 @@ Source0: https://www.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{n Source1: https://www.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version_no_tilde}.tar.sign Source2: gpgkey-F2B41200C54EFB30380C1756C565D5F9D76D583B.gpg +Patch1001: 1001-balance-mkfs-Disable-raid56-modes.patch + BuildRequires: gnupg2 BuildRequires: gcc, autoconf, automake, make BuildRequires: e2fsprogs-devel @@ -149,6 +151,7 @@ popd * Sun Jan 23 2022 Peter Georg - 5.14.2-1.1 - Adapt for CentOS Kmods SIG - Disable zoned block device support +- Disable RAID5/6 * Sat Oct 09 2021 Neal Gompa - 5.14.2-1 - Update to 5.14.2