From: Adam Borowski Date: Tue, 28 Mar 2017 14:55:05 +0000 (+0200) Subject: btrfs: warn about RAID5/6 being experimental at mount time X-Git-Tag: archive/raspbian/6.5.6-1+rpi1^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c3b4e932d4d2fb7cdf46de920d7640d3471c307f;p=linux.git btrfs: warn about RAID5/6 being experimental at mount time Bug-Debian: https://bugs.debian.org/863290 Origin: https://bugs.debian.org/863290#5 Too many people come complaining about losing their data -- and indeed, there's no warning outside a wiki and the mailing list tribal knowledge. Message severity chosen for consistency with XFS -- "alert" makes dmesg produce nice red background which should get the point across. Signed-off-by: Adam Borowski [bwh: Also add_taint() so this is flagged in bug reports] [2023-01-10: still accurate according to btrfs-progs own manpage: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git/commit/?id=922797e15590b836e377d6dc47b828356cafc2a9] Gbp-Pq: Topic debian Gbp-Pq: Name btrfs-warn-about-raid5-6-being-experimental-at-mount.patch --- diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 681594df733..9729a750a09 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3444,6 +3444,15 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device btrfs_set_and_info(fs_info, SSD, "enabling ssd optimizations"); } + if ((fs_info->avail_data_alloc_bits | + fs_info->avail_metadata_alloc_bits | + fs_info->avail_system_alloc_bits) & + BTRFS_BLOCK_GROUP_RAID56_MASK) { + btrfs_alert(fs_info, + "btrfs RAID5/6 is EXPERIMENTAL and has known data-loss bugs"); + add_taint(TAINT_AUX, LOCKDEP_STILL_OK); + } + /* * For devices supporting discard turn on discard=async automatically, * unless it's already set or disabled. This could be turned off by