]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: improve error message is "--grow -n2" used on Linear arrays.
authorNeilBrown <neilb@suse.de>
Tue, 29 Jul 2014 03:37:42 +0000 (13:37 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 29 Jul 2014 03:37:42 +0000 (13:37 +1000)
Linear arrays don't respond to setting raid-disks, only to
adding a device.

Reported-by: mulhern
Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1122146
Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index af59347ca75ee3c8285649c22bbb5617213aff9c..a9c8589c833fac995494abd60abcb794a597fade 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1028,7 +1028,12 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
 
        switch (info->array.level) {
        default:
-               return "Cannot understand this RAID level";
+               return "No reshape is possibly for this RAID level";
+       case LEVEL_LINEAR:
+               if (info->delta_disks != UnSet)
+                       return "Only --add is supported for LINEAR, setting --raid-disks is not needed";
+               else
+                       return "Only --add is supported for LINEAR, other --grow options are not meaningful";
        case 1:
                /* RAID1 can convert to RAID1 with different disks, or
                 * raid5 with 2 disks, or