summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-03-22 17:00:57 +1100
committerNeilBrown <neilb@suse.de>2012-03-22 17:00:57 +1100
commit5ca3a902fd576426c891ec3c20d1edd65d917c5d (patch)
tree107b08007fa3e7128374b62d23e56cddfd87ae7b
parentae6c05ad83eaa06f70bec0b0120c6befa9be5870 (diff)
downloadmdadm-5ca3a902fd576426c891ec3c20d1edd65d917c5d.tar.gz
Grow: print useful error when converting RAID1->RAID5 will fail.
RAID1 can only be converted to RAID0 or RAID5 if the size is a multiple of 4K as we cannot have chunks smaller than 4K. If this might happen, report a useful error message. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--Grow.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Grow.c b/Grow.c
index a0dbb20..e3ef8d4 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1023,6 +1023,10 @@ char *analyse_change(struct mdinfo *info, struct reshape *re)
* raid5 with 2 disks, or
* raid0 with 1 disk
*/
+ if (info->new_level > 1 &&
+ (info->component_size & 7))
+ return "Cannot convert RAID1 of this size - "
+ "reduce size to multiple of 4K first.";
if (info->new_level == 0) {
if (info->delta_disks != UnSet &&
info->delta_disks != 0)