]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: Don't auto-assemble arrays which conflict with mdadm.conf
authorNeilBrown <neilb@suse.de>
Wed, 5 Dec 2012 00:06:55 +0000 (11:06 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 5 Dec 2012 00:06:55 +0000 (11:06 +1100)
When auto-assembling we might find an array which appear in
mdadm.conf.
This can happen if the array (based on UUID) doesn't match what is
in mdadm.conf.
For consistency we should avoid auto-assembling such an array just as
we avoid regular-assembling of the array.

Reported-by: Ross Boylan <ross@biostat.ucsf.edu>
Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c

index 9ef1bf0edd367f600a67ba07b62c25063860e7ac..eeb5e4a1943b7ca885f6c7c865567e7b9fed8ea0 100644 (file)
@@ -385,6 +385,13 @@ static int select_devices(struct mddev_dev *devlist,
                                               devname);
                                goto loop;
                        }
+                       if (match && !ident_matches(match, content, tst,
+                                                   c->homehost, c->update,
+                                                   report_missmatch ? devname : NULL))
+                               /* Array exists  in mdadm.conf but some
+                                * details don't match, so reject it
+                                */
+                               goto loop;
 
                        /* should be safe to try an exclusive open now, we
                         * have rejected anything that some other mdadm might