diff options
author | NeilBrown <neilb@suse.de> | 2012-09-27 16:57:09 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-09-27 16:57:09 +1000 |
commit | 3a84db51a7ea0caf4bd5ca947f53f6156bdd6b2b (patch) | |
tree | 6957c19bfa792fca79a910c04cf132331de7b9c2 | |
parent | ec894f5eb1bc068297bb7f988dca2c3dcf42d644 (diff) | |
download | mdadm-3a84db51a7ea0caf4bd5ca947f53f6156bdd6b2b.tar.gz |
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>
-rw-r--r-- | super-ddf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/super-ddf.c b/super-ddf.c index 5e51c4c..9ea62e0 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -3718,6 +3718,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))) { |