]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: only check 'native format' when really needed.
authorNeilBrown <neilb@suse.de>
Wed, 9 Mar 2011 07:47:24 +0000 (18:47 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 9 Mar 2011 07:47:24 +0000 (18:47 +1100)
The check that the array info is already in 'native format' is
only relevant when restarting a growth, so only perform it then.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index ecbc837e7013f10882761c80d98affead9c79e75..32263b0da8a249208c0fc5b8aaa2e73c51b656ac 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1651,9 +1651,10 @@ static int reshape_array(char *container, int fd, char *devname,
                fprintf(stderr, Name ": %s\n", msg);
                goto release;
        }
-       if (reshape.level != info->array.level ||
-           reshape.before.layout != info->array.layout ||
-           reshape.before.data_disks + reshape.parity != info->array.raid_disks) {
+       if (restart &&
+           (reshape.level != info->array.level ||
+            reshape.before.layout != info->array.layout ||
+            reshape.before.data_disks + reshape.parity != info->array.raid_disks)) {
                fprintf(stderr, Name ": reshape info is not in native format -"
                        " cannot continue.\n");
                goto release;