]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Skip domain check for spare-same-slot
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Sun, 26 Dec 2010 11:36:46 +0000 (22:36 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 26 Dec 2010 11:36:46 +0000 (22:36 +1100)
If lost disk was the only one that belonged to particular domain, array
won't match with that domain any longer. We can achieve this by moving
domain check below the 'target' test.

Signed-off-by: NeilBrown <neilb@suse.de>
Incremental.c

index ee476dab1dd023797c4770163d66e66736fe175e..2b6ba91c1b2c1b0a0189e7923405461f269350eb 100644 (file)
@@ -952,15 +952,6 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
                                        devname, mp->path);
                        goto next;
                }
-               dl = domain_from_array(sra, st2->ss->name);
-               if (!domain_test(dl, pol, st2->ss->name)) {
-                       /* domain test fails */
-                       if (verbose > 1)
-                               fprintf(stderr, Name ": not adding %s to %s as it is not in a compatible domain\n",
-                                       devname, mp->path);
-
-                       goto next;
-               }
                /* test against target.
                 * If 'target' is set and 'bare' is false, we only accept
                 * arrays/containers that match 'target'.
@@ -988,6 +979,16 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
                                goto next;
                }
 
+               dl = domain_from_array(sra, st2->ss->name);
+               if (!domain_test(dl, pol, st2->ss->name)) {
+                       /* domain test fails */
+                       if (verbose > 1)
+                               fprintf(stderr, Name ": not adding %s to %s as"
+                                       " it is not in a compatible domain\n",
+                                       devname, mp->path);
+
+                       goto next;
+               }
                /* all tests passed, OK to add to this array */
                if (!chosen) {
                        chosen = sra;