]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
ddf: allow a non-spare to be used to recovery a missing device.
authorNeilBrown <neilb@suse.de>
Tue, 14 Aug 2012 23:59:55 +0000 (09:59 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 14 Aug 2012 23:59:55 +0000 (09:59 +1000)
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>
super-ddf.c

index 8d8bb22f3b682044130e07d9020c2ad1f321d836..ca517e3942b10df01d3ce941bf78d7e8a5d88cb4 100644 (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))) {