]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: don't auto-assemble if any arrays are listed in mdadm.conf
authorNeilBrown <neilb@suse.de>
Thu, 20 Nov 2008 06:02:55 +0000 (17:02 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 20 Nov 2008 06:02:55 +0000 (17:02 +1100)
Auto-assembly and planned assembly don't really work well together,
it can be confusing.
In particular in mkinitrd or similar creates an mdadm.conf to
assemble a particular array, we shouldn't go assembling any
other arrays as well.

If you want auto assembly, you need to give mdadm a config
file with no ARRAY lines.
  mdadm -Ascpartitions
can do this.

Signed-off-by: NeilBrown <neilb@suse.de>
mdadm.c

diff --git a/mdadm.c b/mdadm.c
index 2bd963a58c2fbf9e3158b88bc2cb5938971ddd8b..e0f51b7fc87469365935fe7e6a95bb1de451fe86 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1092,9 +1092,9 @@ int main(int argc, char *argv[])
                                               array_list,
                                               NULL, NULL,
                                               readonly, runstop, NULL, homehost, verbose-quiet, force);
-                               if (rv == 0) cnt++;
+                               cnt++;
                        }
-                       if (homehost) {
+                       if (homehost && cnt == 0) {
                                /* Maybe we can auto-assemble something.
                                 * Repeatedly call Assemble in auto-assemble mode
                                 * until it fails