diff options
author | mwilck@arcor.de <mwilck@arcor.de> | 2013-07-25 20:59:12 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-07-30 02:57:13 +0200 |
commit | 62ff3c40c1b42f85b902b8010ee69d9382cfc407 (patch) | |
tree | 2d9f39d06425e439e614d2b3b36a75d6f035a74d /super-ddf.c | |
parent | DDF: ddf_activate_spare: Add RAID10 code (diff) | |
download | mdadm-62ff3c40c1b42f85b902b8010ee69d9382cfc407.tar.xz mdadm-62ff3c40c1b42f85b902b8010ee69d9382cfc407.zip |
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>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |