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/4.9.82-1+deb9u3+rpi1_jessie~8^2~103 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3f95f99d941fca36b843093b2d47ce6e3b75b1ca;p=linux-4.9.git btrfs: warn about RAID5/6 being experimental at mount time 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] 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 1cd325765aaa..44981fa948a6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3098,6 +3098,15 @@ retry_root_backup: btrfs_set_opt(fs_info->mount_opt, SSD); } + 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_USER, LOCKDEP_STILL_OK); + } + /* * Mount does not set all options immediately, we can do it now and do * not have to wait for transaction commit