diff --git a/1001-balance-mkfs-Disable-raid56-modes.patch b/1001-balance-mkfs-Disable-raid56-modes.patch new file mode 100644 index 0000000000000000000000000000000000000000..b1c7404a395bac3f88d9a73d0dc76ed6a7131b20 --- /dev/null +++ b/1001-balance-mkfs-Disable-raid56-modes.patch @@ -0,0 +1,99 @@ +From 1338ce1136aea6cc83f7ee6d78c5ca6a07bb38d6 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,7 +376,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"), +@@ -400,7 +399,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)); +@@ -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; ++ if (ptrs[i]->target & BTRFS_BLOCK_GROUP_RAID56_MASK) { ++ error("RAID5/6 support has known problems and is disabled."); ++ return 1; + } +- 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); +- } +- 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 f9e8be74..11c0fc26 100644 +--- a/mkfs/main.c ++++ b/mkfs/main.c +@@ -1214,8 +1214,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.35.1 + diff --git a/btrfs-progs-v6.1.2.tar.xz b/btrfs-progs-v6.1.2.tar.xz deleted file mode 100644 index 86286ec4461fb1d5e0e3c185bd70bf153fd4dfe9..0000000000000000000000000000000000000000 Binary files a/btrfs-progs-v6.1.2.tar.xz and /dev/null differ diff --git a/btrfs-progs-v6.15.tar.sign b/btrfs-progs-v6.15.tar.sign new file mode 100644 index 0000000000000000000000000000000000000000..0ba02c97475b7dd7cf9a1543449caef71f445ebf Binary files /dev/null and b/btrfs-progs-v6.15.tar.sign differ diff --git a/btrfs-progs-v6.15.tar.xz b/btrfs-progs-v6.15.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..71d16339758f43b33db594ed27cd73cf478284c4 Binary files /dev/null and b/btrfs-progs-v6.15.tar.xz differ diff --git a/btrfs-progs.spec b/btrfs-progs.spec index c2439f75322d3fc68109388c3147d4df5b8fe0bd..f8f40a19433db8648435e0d012ed60424fe4db97 100644 --- a/btrfs-progs.spec +++ b/btrfs-progs.spec @@ -1,20 +1,22 @@ -%define anolis_release 3 +%define anolis_release 1 Name: btrfs-progs Summary: An userspace programs named btrfs -Version: 6.1.2 +Version: 6.15 Release: %{anolis_release}%{?dist} License: GPLv2 URL: https://btrfs.wiki.kernel.org/index.php/Main_Page -Source0: https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version}.tar.xz -Source1: https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version}.tar.sign -Source2: gpgkey-F2B41200C54EFB30380C1756C565D5F9D76D583B.gpg +Source0: https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v6.15.tar.xz +Source1: https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v6.15.tar.sign +Source2: gpgkey-F2B41200C54EFB30380C1756C565D5F9D76D583B.gpg +Patch1: 1001-balance-mkfs-Disable-raid56-modes.patch BuildRequires: gnupg2 e2fsprogs-devel libacl-devel, lzo-devel systemd BuildRequires: gcc, autoconf, automake, make BuildRequires: pkgconfig(blkid) pkgconfig(uuid) pkgconfig(zlib) pkgconfig(libgcrypt) >= 1.8.0 pkgconfig(libudev) pkgconfig(libzstd) >= 1.0.0 BuildRequires: python3-devel >= 3.4 python3-sphinx python3-setuptools python3-rpm-macros +BuildRequires: python3dist(sphinx-rtd-theme) %description Btrfs is a modern copy on write (COW) filesystem for Linux @@ -143,6 +145,10 @@ popd %{python3_sitearch}/btrfsutil.*.so %changelog +* Wed Sep 17 2025 wenyuzifang - 6.15-1 +- Updated to version 6.15 to fix xxxxxx +- Prevent unsafe RAID5/6 usage by blocking it explicitly to avoid data corruption + * Mon Mar 11 2024 Bo Ren - 6.1.2-3 - Rebuild with python3.11 - Fix build error