ddf: allow a non-spare to be used to recovery a missing device.

If a DDF has two arrays sharing devices and one device fails, then
as soon as the spare is used to recover one of the arrays it isn't
spare any more and so is not chosen for the other array.

Work around this for now by allowing a non-spare to be used if it has
enough space.

Reported-by: Albert Pauw <albert.pauw@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2012-08-15 09:59:55 +10:00
parent 613b0d174d
commit e0e7aeaa18
1 changed files with 4 additions and 0 deletions

View File

@ -3693,6 +3693,10 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a,
} else if (ddf->phys->entries[dl->pdnum].type &
__cpu_to_be16(DDF_Global_Spare)) {
is_global = 1;
} else if (!(ddf->phys->entries[dl->pdnum].state &
__cpu_to_be16(DDF_Failed))) {
/* we can possibly use some of this */
is_global = 1;
}
if ( ! (is_dedicated ||
(is_global && global_ok))) {