From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cn.fujitsu.com ([59.151.112.132]:32590 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752089AbcIBBly (ORCPT ); Thu, 1 Sep 2016 21:41:54 -0400 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id C6D6A403C872 for ; Fri, 2 Sep 2016 09:41:48 +0800 (CST) From: Qu Wenruo To: Subject: [PATCH 1/2] btrfs-progs: mkfs: Warn user for minimal RAID5/6 devices setup Date: Fri, 2 Sep 2016 09:41:44 +0800 Message-ID: <20160902014145.7817-1-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 --- Documentation/mkfs.btrfs.asciidoc | 15 +++++++++++---- utils.c | 10 ++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Documentation/mkfs.btrfs.asciidoc b/Documentation/mkfs.btrfs.asciidoc index 98fe694..846c08f 100644 --- a/Documentation/mkfs.btrfs.asciidoc +++ b/Documentation/mkfs.btrfs.asciidoc @@ -263,18 +263,25 @@ 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) { @@ -3349,6 +3349,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"); -- 2.9.3