]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix tests on ->container and ->member
authorNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:18:25 +0000 (15:18 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:18:25 +0000 (15:18 +1000)
For container= and member= to be effective in an mdadm.conf line
they must both be present.  So when checking for their absence we
need container != NULL || member != NULL.

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

index 4966a79822045b19331497952f9f1ad37259e9dc..13953bda495b5a8a0a9a530608017322f8a7e296 100644 (file)
@@ -140,7 +140,7 @@ int Assemble(struct supertype *st, char *mddev,
        int clean;
        int auto_assem = (mddev == NULL && !ident->uuid_set &&
                          ident->super_minor == UnSet && ident->name[0] == 0
-                         && ident->container == NULL && ident->member == NULL);
+                         && (ident->container == NULL || ident->member == NULL));
        int old_linux = 0;
        int vers = vers; /* Keep gcc quite - it really is initialised */
        struct {
@@ -504,7 +504,7 @@ int Assemble(struct supertype *st, char *mddev,
                break;
        }
        if (!auto_assem && trustworthy == FOREIGN)
-               /* If the array is listed in mdadm or on
+               /* If the array is listed in mdadm.conf or on
                 * command line, then we trust the name
                 * even if the array doesn't look local
                 */
index 0d5b3f9aac7a929e523224ef241ebdbf858cde67..fd757ad009ddca3c52cb5f88d1c3960ee44182d7 100644 (file)
--- a/config.c
+++ b/config.c
@@ -567,7 +567,7 @@ void arrayline(char *line)
        }
        if (mis.uuid_set == 0 && mis.devices == NULL &&
            mis.super_minor == UnSet && mis.name[0] == 0 &&
-           (mis.container == NULL && mis.member == NULL))
+           (mis.container == NULL || mis.member == NULL))
                fprintf(stderr, Name ": ARRAY line %s has no identity information.\n", mis.devname);
        else {
                mi = malloc(sizeof(*mi));