Incr: fix breakage in count_active.
If the second device is much newer than the first, but has a lower raid_disk number, we clear 'avail' badly and don't set up 'best' properly. Fix these things. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
19482bcc40
commit
47c7a4be14
|
@ -776,9 +776,10 @@ static int count_active(struct supertype *st, struct mdinfo *sra,
|
|||
best[info.disk.raid_disk] = devnum;
|
||||
st->ss->getinfo_super(st, bestinfo, NULL);
|
||||
} else { /* info.events much bigger */
|
||||
memset(avail, 0, info.disk.raid_disk);
|
||||
memset(avail, 0, raid_disks);
|
||||
max_events = info.events;
|
||||
avail[info.disk.raid_disk] = 2;
|
||||
best[info.disk.raid_disk] = devnum;
|
||||
st->ss->getinfo_super(st, bestinfo, NULL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue