From: Qu Wenruo Date: Tue, 6 Sep 2016 15:35:06 +0000 (+0200) Subject: btrfs-progs: mkfs: Warn user for minimal RAID5/6 devices setup X-Git-Tag: upstream/4.16.1~1311 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53c4e289c237e4f1008fdec54256e81c24c8882a;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: mkfs: Warn user for minimal RAID5/6 devices setup For RAID5, 2 devices setup is just RAID1 with more overhead. For RAID6, 3 devices setup is RAID1 with 3 copies, not what most user want. So warn user at mkfs time for such case, and add explain in man pages. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- diff --git a/Documentation/mkfs.btrfs.asciidoc b/Documentation/mkfs.btrfs.asciidoc index 98fe694..7d19a14 100644 --- a/Documentation/mkfs.btrfs.asciidoc +++ b/Documentation/mkfs.btrfs.asciidoc @@ -263,18 +263,26 @@ There are the following block group types available: .2+^. 1 && - ((metadata_profile | data_profile) & BTRFS_BLOCK_GROUP_DUP)) { + if (dev_cnt > 1 && profile & BTRFS_BLOCK_GROUP_DUP) { warning("DUP is not recommended on filesystem with multiple devices"); } if (metadata_profile & ~allowed) { @@ -3315,6 +3315,12 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile, return 1; } + if (dev_cnt == 3 && profile & BTRFS_BLOCK_GROUP_RAID6) { + warning("RAID6 is not recommended on filesystem with 3 devices only"); + } + if (dev_cnt == 2 && profile & BTRFS_BLOCK_GROUP_RAID5) { + warning("RAID5 is not recommended on filesystem with 2 devices only"); + } warning_on(!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP) && ssd, "DUP may not actually lead to 2 copies on the device, see manual page");