DDF: ddf_activate_spare: only activate good drives

Do not try to activate drives marked missing or failed.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
mwilck@arcor.de 2013-07-25 20:59:12 +02:00 committed by NeilBrown
parent 7733b91d37
commit 62ff3c40c1
1 changed files with 7 additions and 0 deletions

View File

@ -4773,6 +4773,13 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a,
/* For each slot, if it is not working, find a spare */
dl = ddf->dlist;
for (i = 0; i < a->info.array.raid_disks; i++) {
be16 state = ddf->phys->entries[dl->pdnum].state;
if (be16_and(state,
cpu_to_be16(DDF_Failed|DDF_Missing)) ||
!be16_and(state,
cpu_to_be16(DDF_Online)))
continue;
for (d = a->info.devs ; d ; d = d->next)
if (d->disk.raid_disk == i)
break;