Re: [PATCH 1/2] select_devices: fix scanning of container members with dev list
From: NeilBrown <hidden>
Date: 2013-06-24 06:55:47
On Thu, 20 Jun 2013 22:21:04 +0200 mwilck@arcor.de wrote:
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 <redacted>
Hi Martin, I really don't like this. If there is a "device=" entry then it should not even open anything not listed. Can you give me more details about the problem you are experiencing? Maybe the problem is in "mdadm -Dbv". Thanks, NeilBrown
quoted hunk ↗ jump to hunk
--- 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);
Attachments
- signature.asc [application/pgp-signature] 828 bytes