summaryrefslogtreecommitdiff
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-11-22 17:04:20 +1100
committerNeilBrown <neilb@suse.de>2012-11-22 17:04:20 +1100
commit66eb2c93a619eb1d79dc653fd91add159aa3d1ff (patch)
treee938408feed2924757c2e1608bef10a840f69968 /Assemble.c
parent13f2dd6be5618ff556f9a364903e4b95558115e1 (diff)
Assemble: ensure that <ignore>d arrays are not auto-assembled.
It isn't enough to simply not assemble arrays found to be called <ignore>, as the final stage of auto-assemble doesn't check for names in mdadm.conf. So add a check to Assemble, similar to the check in Incremental() Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index c2fa0961..9ef1bf0e 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -362,6 +362,8 @@ static int select_devices(struct mddev_dev *devlist,
tmpdev = NULL;
goto loop;
} else {
+ int rv = 0;
+ struct mddev_ident *match;
content = *contentp;
tst->ss->getinfo_super(tst, content, NULL);
@@ -370,7 +372,20 @@ static int select_devices(struct mddev_dev *devlist,
c->homehost, c->update,
report_missmatch ? devname : NULL))
goto loop;
-
+
+ match = conf_match(tst, content, devname,
+ report_missmatch ? c->verbose : -1,
+ &rv);
+ if (!match && rv == 2)
+ goto loop;
+ if (match && match->devname &&
+ strcasecmp(match->devname, "<ignore>") == 0) {
+ if (report_missmatch)
+ pr_err("%s is a member of an explicitly ignored array\n",
+ devname);
+ goto loop;
+ }
+
/* should be safe to try an exclusive open now, we
* have rejected anything that some other mdadm might
* be looking at