summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-05-11 15:19:30 +1000
committerNeilBrown <neilb@suse.de>2009-05-11 15:19:30 +1000
commit05833051ee595c8d356a2a1ed61f7d9e6f4186ef (patch)
tree2f2c432b63a905cc7c3b7ca077630ab034988989
parentdb2d001cee64cd330cc2ab24ddefed48eb67fc7b (diff)
downloadmdadm-05833051ee595c8d356a2a1ed61f7d9e6f4186ef.tar.gz
mdadm-05833051ee595c8d356a2a1ed61f7d9e6f4186ef.tar.xz
mdadm-05833051ee595c8d356a2a1ed61f7d9e6f4186ef.zip
Assemble/Incr : minor tidy up of setting 'trustworthy'.
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--Assemble.c14
-rw-r--r--Incremental.c2
2 files changed, 6 insertions, 10 deletions
diff --git a/Assemble.c b/Assemble.c
index 13953bd..c079f6b 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -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;
diff --git a/Incremental.c b/Incremental.c
index 7d6de98..8908eec 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -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,