]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: change load_devices to return most_recent 'st' value.
authorNeilBrown <neilb@suse.de>
Tue, 25 Feb 2014 04:04:16 +0000 (15:04 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 25 Feb 2014 04:04:16 +0000 (15:04 +1100)
This means that

st->ss->getinfo_super(st, content, NULL);
clean = content->array.state & 1;

will get an up-to-date value for 'clean'.  This fix allows
  tests/03r5assem-failed
to work.

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

index 658df91de90969151b11160ca17573ce02725f87..05ace561fb507bb6a557b3d15e6d35f18517400b 100644 (file)
@@ -703,8 +703,12 @@ static int load_devices(struct devs *devices, char *devmap,
                if (devices[devcnt].i.disk.state == 6) {
                        if (most_recent < 0 ||
                            devices[devcnt].i.events
-                           > devices[most_recent].i.events)
+                           > devices[most_recent].i.events) {
+                               struct supertype *tmp = tst;
+                               tst = st;
+                               st = tmp;
                                most_recent = devcnt;
+                       }
                }
                tst->ss->free_super(tst);
                free(tst);