summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index cec7c738..a31840eb 100644
--- a/utils.c
+++ b/utils.c
@@ -3280,6 +3280,7 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
u64 dev_cnt, int mixed, int ssd)
{
u64 allowed = 0;
+ u64 profile = metadata_profile | data_profile;
switch (dev_cnt) {
default:
@@ -3294,8 +3295,7 @@ int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
allowed |= BTRFS_BLOCK_GROUP_DUP;
}
- if (dev_cnt > 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");