From: NeilBrown Date: Thu, 27 Sep 2012 06:57:09 +0000 (+1000) Subject: ddf: allow a non-spare to be used to recovery a missing device. X-Git-Tag: mdadm-3.2.6~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a84db51a7ea0caf4bd5ca947f53f6156bdd6b2b;p=thirdparty%2Fmdadm.git 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 --- 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))) {