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:
NeilBrown 2011-06-15 12:21:26 +10:00
parent 19482bcc40
commit 47c7a4be14
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}
}