From 3a84db51a7ea0caf4bd5ca947f53f6156bdd6b2b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 27 Sep 2012 16:57:09 +1000 Subject: [PATCH] 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 Signed-off-by: NeilBrown --- super-ddf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/super-ddf.c b/super-ddf.c index 5e51c4cd..9ea62e0f 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))) { -- 2.47.2