]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble/Incr : minor tidy up of setting 'trustworthy'.
authorNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:19:30 +0000 (15:19 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:19:30 +0000 (15:19 +1000)
Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c
Incremental.c

index 13953bda495b5a8a0a9a530608017322f8a7e296..c079f6b34f4562abdee5621b611ca6b10f1be7ab 100644 (file)
@@ -480,17 +480,14 @@ int Assemble(struct supertype *st, char *mddev,
        if (!st || !st->sb || !content)
                return 2;
 
-       /* Now need to open array the device.  Use create_mddev */
+       /* Now need to open the array device.  Use create_mddev */
        if (content == &info)
                st->ss->getinfo_super(st, content);
 
        trustworthy = FOREIGN;
+       name = content->name;
        switch (st->ss->match_home(st, homehost)
                ?: st->ss->match_home(st, "any")) {
-       case 0:
-               trustworthy = FOREIGN;
-               name = content->name;
-               break;
        case 1:
                trustworthy = LOCAL;
                name = strchr(content->name, ':');
@@ -499,18 +496,15 @@ int Assemble(struct supertype *st, char *mddev,
                else
                        name = content->name;
                break;
-       case -1:
-               trustworthy = FOREIGN;
-               break;
        }
-       if (!auto_assem && trustworthy == FOREIGN)
+       if (!auto_assem)
                /* 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
                 */
                trustworthy = LOCAL;
 
-       if (content->name[0] == 0 &&
+       if (name[0] == 0 &&
            content->array.level == LEVEL_CONTAINER) {
                name = content->text_version;
                trustworthy = METADATA;
index 7d6de981427663bf96574ca848f301dadce6e1d3..8908eeced7efc8fb329000344f34821777905f79 100644 (file)
@@ -810,6 +810,8 @@ int Incremental_container(struct supertype *st, char *devname, int verbose,
                                                match->container, match->member);
                                return 2;
                        }
+                       if (match)
+                               trustworthy = LOCAL;
 
                        mdfd = create_mddev(match ? match->devname : NULL,
                                            ra->name,