summaryrefslogtreecommitdiffstats
path: root/Incremental.c
diff options
context:
space:
mode:
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>2010-12-26 12:36:46 +0100
committerNeilBrown <neilb@suse.de>2010-12-26 12:36:46 +0100
commitb6b3f0f7ebb00c264421fb09e5634fd28994e0e7 (patch)
treeead83b5e91c78b68b3c5ae0c89dd31c2964e50e5 /Incremental.c
parentAdded test for array degradation for spare-same-slot (diff)
downloadmdadm-b6b3f0f7ebb00c264421fb09e5634fd28994e0e7.tar.xz
mdadm-b6b3f0f7ebb00c264421fb09e5634fd28994e0e7.zip
Skip domain check for spare-same-slot
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>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/Incremental.c b/Incremental.c
index ee476dab..2b6ba91c 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -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;