[PATCH 1/2] select_devices: fix scanning of container members with dev list

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

 



commit b3908491 "Detail: fix --brief --verbose" introduced a
problem when a mdadm.conf file generated with
"mdadm --Detail --brief --verbose" is later scanned with
"mdadm --Assemble --scan --config=mdadm.conf"

mdadm -Dbv will print a "devices" list now, but because the
container device is not in that list, it won't be considered
for assembly.

This patch fixes that by moving the test for member devices
further down, after the check for a container.

Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 Assemble.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index c927c20..1f023e8 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -170,13 +170,6 @@ static int select_devices(struct mddev_dev *devlist,
 		if (tmpdev->used > 1)
 			continue;
 
-		if (ident->devices &&
-		    !match_oneof(ident->devices, devname)) {
-			if (report_mismatch)
-				pr_err("%s is not one of %s\n", devname, ident->devices);
-			continue;
-		}
-
 		tst = dup_super(st);
 
 		dfd = dev_open(devname, O_RDONLY);
@@ -365,6 +358,14 @@ static int select_devices(struct mddev_dev *devlist,
 			int rv = 0;
 			struct mddev_ident *match;
 
+			if (ident->devices &&
+			    !match_oneof(ident->devices, devname)) {
+				if (report_mismatch)
+					pr_err("%s is not one of %s\n", devname,
+					       ident->devices);
+				goto loop;
+			}
+
 			content = *contentp;
 			tst->ss->getinfo_super(tst, content, NULL);
 
-- 
1.7.1
--
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