From: mwilck@arcor.de Date: Thu, 25 Jul 2013 18:59:12 +0000 (+0200) Subject: DDF: ddf_activate_spare: only activate good drives X-Git-Tag: mdadm-3.3~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62ff3c40c1b42f85b902b8010ee69d9382cfc407;p=thirdparty%2Fmdadm.git DDF: ddf_activate_spare: only activate good drives Do not try to activate drives marked missing or failed. Signed-off-by: NeilBrown --- diff --git a/super-ddf.c b/super-ddf.c index 13a2e61a..ae1222c4 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -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;