]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: Fix critical-section-recovery when assembling a growing array.
authorNeilBrown <neilb@suse.de>
Wed, 31 Oct 2012 06:02:49 +0000 (17:02 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 20 Nov 2012 01:08:36 +0000 (12:08 +1100)
commit aacb2f816afbddf56c406039b8e2e6c0dbc8a8a0
    Assemble: add support for replacement devices.

broke the restoring of the 'critical section' because it messed up the
list of file descriptors passed to Grow_restart.  Put it back the way
it should be.

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

index dbac9aecfb0bd96a9ce87b1f15ccc4d0ddfb4dd1..0e51fa472473377feab0a19172e6a8389b8488f4 100644 (file)
@@ -1595,8 +1595,8 @@ try_again:
                        pr_err(":%s has an active reshape - checking "
                               "if critical section needs to be restored\n",
                               chosen_name);
-               for (i=0; i<bestcnt; i++) {
-                       int j = best[i];
+               for (i = 0; i < bestcnt/2; i++) {
+                       int j = best[i*2];
                        if (j >= 0) {
                                fdlist[i] = dev_open(devices[j].devname,
                                                     devices[j].included
@@ -1614,7 +1614,7 @@ try_again:
                        if (st->ss->external && st->ss->recover_backup)
                                err = st->ss->recover_backup(st, content);
                        else
-                               err = Grow_restart(st, content, fdlist, bestcnt,
+                               err = Grow_restart(st, content, fdlist, bestcnt/2,
                                                   c->backup_file, c->verbose > 0);
                        if (err && c->invalid_backup) {
                                if (c->verbose > 0)