From 47c7a4be1436a8cae2fefc05bb227712d8b6f4ec Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 15 Jun 2011 12:21:26 +1000 Subject: 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 --- Incremental.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Incremental.c b/Incremental.c index f576cba..aa98d06 100644 --- a/Incremental.c +++ b/Incremental.c @@ -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); } } -- cgit v1.2.1