From 2acec45101d7267c90f21754a463ea8535ceb0b8 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 24 Jan 2025 20:23:45 -0500 Subject: [PATCH] Add RHEL-only downstream patch to disable raid56 modes for now --- 1001-balance-mkfs-Disable-raid56-modes.patch | 99 ++++++++++++++++++++ btrfs-progs.spec | 14 ++- 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 1001-balance-mkfs-Disable-raid56-modes.patch diff --git a/1001-balance-mkfs-Disable-raid56-modes.patch b/1001-balance-mkfs-Disable-raid56-modes.patch new file mode 100644 index 0000000..e7661d3 --- /dev/null +++ b/1001-balance-mkfs-Disable-raid56-modes.patch @@ -0,0 +1,99 @@ +From c840e616c03a1d735c7a6c0ba1c6473da1595ba2 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 | 34 ++++------------------------------ + mkfs/main.c | 4 ++-- + 2 files changed, 6 insertions(+), 32 deletions(-) + +diff --git a/cmds/balance.c b/cmds/balance.c +index 4c73273d..fec6a1a3 100644 +--- a/cmds/balance.c ++++ b/cmds/balance.c +@@ -365,7 +365,7 @@ static const char * const cmd_balance_start_usage[] = { + OPTLINE("-d[filters]", "act on data chunks with optional filters (no space in between)"), + OPTLINE("-m[filters]", "act on metadata chunks with optional filters (no space in between)"), + OPTLINE("-s[filters]", "act on system chunks (only under -f) with optional filters (no space in between)"), +- OPTLINE("-f", "force a reduction of metadata integrity, or skip timeout when converting to RAID56 profiles"), ++ OPTLINE("-f", "force a reduction of metadata integrity"), + OPTLINE("--full-balance", "do not print warning and do not delay start"), + OPTLINE("--background|--bg", "run the balance as a background process"), + OPTLINE("--enqueue", "wait if there's another exclusive operation running, otherwise continue"), +@@ -386,7 +386,6 @@ static int cmd_balance_start(const struct cmd_struct *cmd, + bool background = false; + bool enqueue = false; + unsigned start_flags = 0; +- bool raid56_warned = false; + int i; + + memset(&args, 0, sizeof(args)); +@@ -492,8 +491,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"); +@@ -503,33 +500,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 c9dbd234..e1a5b190 100644 +--- a/mkfs/main.c ++++ b/mkfs/main.c +@@ -1501,8 +1501,8 @@ int BOX_MAIN(mkfs)(int argc, char **argv) + + if ((data_profile | metadata_profile) & BTRFS_BLOCK_GROUP_RAID56_MASK) { + features.incompat_flags |= 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.48.0 + diff --git a/btrfs-progs.spec b/btrfs-progs.spec index f34053d..b06cf35 100644 --- a/btrfs-progs.spec +++ b/btrfs-progs.spec @@ -3,7 +3,7 @@ Name: btrfs-progs Version: 6.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Userspace programs for btrfs License: GPL-2.0-only @@ -12,6 +12,10 @@ 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 +# Special patch source, conditionally applied +## Disable RAID56 modes (RHEL-only) +Source1001: 1001-balance-mkfs-Disable-raid56-modes.patch + BuildRequires: gnupg2 BuildRequires: gcc, autoconf, automake, make BuildRequires: git-core @@ -91,6 +95,11 @@ btrfs filesystem-specific programs in Python. xzcat '%{SOURCE0}' | %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data=- %autosetup -n %{name}-v%{version_no_tilde} -S git_am +%if 0%{?rhel} +# Specially apply this source +%{?__scm_source_timestamp:GIT_COMMITTER_DATE=%{__scm_source_timestamp}} git am --reject %{SOURCE1001} +%endif + %build ./autogen.sh %configure CFLAGS="%{optflags} -fno-strict-aliasing" --with-crypto=libgcrypt --disable-python @@ -150,6 +159,9 @@ popd %{python3_sitearch}/btrfsutil-*.egg-info/ %changelog +* Fri Jan 24 2025 Neal Gompa - 6.12-3 +- Add RHEL-only downstream patch to disable raid56 modes for now + * Thu Jan 16 2025 Fedora Release Engineering - 6.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild