Grow: analyse_change add notification about only 2-device can be convert from RAID1 to RAID5

Notify "Can only convert a 2-device array to RAID5" instead of
"Impossibly level change request for RAID1" when convert from
RAID1 to RAID5 if the disk num is not equal two like RAID4/5->RAID1
did.

Signed-off-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
Yi Zhang 2016-03-11 17:26:40 +08:00 committed by Jes Sorensen
parent 1a6dd6b9c1
commit a58e0da443
1 changed files with 3 additions and 0 deletions

3
Grow.c
View File

@ -1077,6 +1077,9 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
re->level = 1;
return NULL;
}
if (info->array.raid_disks != 2 &&
info->new_level == 5)
return "Can only convert a 2-device array to RAID5";
if (info->array.raid_disks == 2 &&
info->new_level == 5) {