1 From 5141638c54535b4ac80b8481404d868a63a18ecd Mon Sep 17 00:00:00 2001
2 From: NeilBrown <neilb@suse.de>
3 Date: Tue, 29 Jul 2014 13:48:23 +1000
4 Subject: [PATCH] Assemble: Only fail auto-assemble in face of mdadm.conf
7 We should never auto-assemble things that conflict with mdadm.conf
8 However explicit assembly requests should be allowed.
11 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1070245
12 Signed-off-by: NeilBrown <neilb@suse.de>
14 Assemble.c | 47 ++++++++++++++++++++++++++---------------------
15 1 file changed, 26 insertions(+), 21 deletions(-)
17 diff --git a/Assemble.c b/Assemble.c
18 index aca28be..cdcdb0f 100644
21 @@ -366,9 +366,6 @@ static int select_devices(struct mddev_dev *devlist,
26 - struct mddev_ident *match;
29 tst->ss->getinfo_super(tst, content, NULL);
31 @@ -377,25 +374,33 @@ static int select_devices(struct mddev_dev *devlist,
32 report_mismatch ? devname : NULL))
35 - match = conf_match(tst, content, devname,
36 - report_mismatch ? c->verbose : -1,
38 - if (!match && rv == 2)
40 - if (match && match->devname &&
41 - strcasecmp(match->devname, "<ignore>") == 0) {
42 - if (report_mismatch)
43 - pr_err("%s is a member of an explicitly ignored array\n",
47 - if (match && !ident_matches(match, content, tst,
48 - c->homehost, c->update,
49 - report_mismatch ? devname : NULL))
50 - /* Array exists in mdadm.conf but some
51 - * details don't match, so reject it
53 + /* Never auto-assemble things that conflict
54 + * with mdadm.conf in some way
57 + struct mddev_ident *match;
60 + match = conf_match(tst, content, devname,
61 + report_mismatch ? c->verbose : -1,
63 + if (!match && rv == 2)
65 + if (match && match->devname &&
66 + strcasecmp(match->devname, "<ignore>") == 0) {
67 + if (report_mismatch)
68 + pr_err("%s is a member of an explicitly ignored array\n",
72 + if (match && !ident_matches(match, content, tst,
73 + c->homehost, c->update,
74 + report_mismatch ? devname : NULL))
75 + /* Array exists in mdadm.conf but some
76 + * details don't match, so reject it
81 /* should be safe to try an exclusive open now, we
82 * have rejected anything that some other mdadm might