linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] select_devices: fix scanning of container members with dev list
@ 2013-06-20 20:21 mwilck
  2013-06-20 20:21 ` [PATCH 2/2] Detail: deterministic ordering in --brief --verbose mwilck
  2013-06-24  6:55 ` [PATCH 1/2] select_devices: fix scanning of container members with dev list NeilBrown
  0 siblings, 2 replies; 8+ messages in thread
From: mwilck @ 2013-06-20 20:21 UTC (permalink / raw)
  To: neilb, linux-raid; +Cc: mwilck

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@arcor.de>
---
 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-02  1:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 20:21 [PATCH 1/2] select_devices: fix scanning of container members with dev list mwilck
2013-06-20 20:21 ` [PATCH 2/2] Detail: deterministic ordering in --brief --verbose mwilck
2013-06-20 20:26   ` Martin Wilck
2013-06-24  6:57   ` NeilBrown
2013-06-24  6:55 ` [PATCH 1/2] select_devices: fix scanning of container members with dev list NeilBrown
2013-06-27 18:15   ` Martin Wilck
2013-06-27 19:38     ` Martin Wilck
2013-07-02  1:20       ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).