]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Assemble.c
tests/06name: adjust for homehost
[thirdparty/mdadm.git] / Assemble.c
index e421f22d2eddd0ddfd0e307b95fdb27a08e98e58..0aff1be8350c85afb7747d83f746949ed30214b7 100644 (file)
@@ -138,7 +138,9 @@ int Assemble(struct supertype *st, char *mddev,
         */
        int mdfd;
        int clean;
-       int auto_assem = (mddev == NULL);
+       int auto_assem = (mddev == NULL && !ident->uuid_set &&
+                         ident->super_minor == UnSet && ident->name[0] == 0
+                         && ident->container == NULL && ident->member == NULL);
        int old_linux = 0;
        int vers = vers; /* Keep gcc quite - it really is initialised */
        struct {
@@ -1167,6 +1169,7 @@ int Assemble(struct supertype *st, char *mddev,
                }
                if (auto_assem)
                        ioctl(mdfd, STOP_ARRAY, NULL);
+               close(mdfd);
                return 1;
        } else {
                /* The "chosen_drive" is a good choice, and if necessary, the superblock has