]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: don't let analyse_change see new level from metadata.
authorNeilBrown <neilb@suse.de>
Wed, 9 Mar 2011 07:53:09 +0000 (18:53 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 9 Mar 2011 07:53:09 +0000 (18:53 +1100)
This is a bit of a hack - probably analyse change needs to be
re-written a bit to handle this properly.

However when the metadata deduced the intermediate state for a
reshaping array, the 'new_level' it sets should not be used to
interpret the 'delta_disks' number.
So in that case, hide the new_level while calling analyse_change.

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

diff --git a/Grow.c b/Grow.c
index e9327226079485ba875b111f2cde3d662413488b..40cb929191cd65b3bd8fd8fcdca2c4ce6570fe4d 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1649,7 +1649,13 @@ static int reshape_array(char *container, int fd, char *devname,
        int done;
        struct mdinfo *sra = NULL;
 
-       msg = analyse_change(info, &reshape);
+       if (info->reshape_active) {
+               int new_level = info->new_level;
+               info->new_level = UnSet;
+               msg = analyse_change(info, &reshape);
+               info->new_level = new_level;
+       } else
+               msg = analyse_change(info, &reshape);
        if (msg) {
                fprintf(stderr, Name ": %s\n", msg);
                goto release;