[PATCH 3/5] Skip domain check for spare-same-slot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 Incremental.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index 137bd75..8d9f825 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -954,15 +954,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'.
@@ -990,6 +981,15 @@ 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;

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux