]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: analyse_change add notification about only 2-device can be convert from RAID1...
authorYi Zhang <yizhan@redhat.com>
Fri, 11 Mar 2016 09:26:40 +0000 (17:26 +0800)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 11 Mar 2016 17:40:47 +0000 (12:40 -0500)
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>
Grow.c

diff --git a/Grow.c b/Grow.c
index d9db00be18638bcafd41d62e9c56d3c310ef4f68..3204135bed303e76bee321d2481d0eb925cb52fc 100755 (executable)
--- a/Grow.c
+++ b/Grow.c
@@ -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) {