diff options
author | NeilBrown <neilb@suse.de> | 2011-06-15 12:21:26 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-06-15 12:21:26 +1000 |
commit | 47c7a4be1436a8cae2fefc05bb227712d8b6f4ec (patch) | |
tree | 0cc5768e44ed42ee915b8e2f50680709c275f218 /Incremental.c | |
parent | 19482bcc403cf785509a078dcb77f104a710b71d (diff) |
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>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Incremental.c b/Incremental.c index f576cbae..aa98d06b 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); } } |