summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Assemble.c5
-rw-r--r--Incremental.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/Assemble.c b/Assemble.c
index 2c52f07..e75c7e5 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -515,6 +515,11 @@ int Assemble(struct supertype *st, char *mddev,
conf_name_is_free(name))
trustworthy = LOCAL;
+ if (trustworthy == LOCAL &&
+ strchr(name, ':'))
+ /* Ignore 'host:' prefix of name */
+ name = strchr(name, ':')+1;
+
mdfd = create_mddev(mddev, name, ident->autof, trustworthy,
chosen_name);
if (mdfd < 0) {
diff --git a/Incremental.c b/Incremental.c
index c5ec634..8e711d9 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -260,12 +260,8 @@ int Incremental(char *devname, int verbose, int runstop,
return Incremental_container(st, devname, verbose, runstop,
autof, trustworthy);
}
- name_to_use = strchr(info.name, ':');
- if (name_to_use)
- name_to_use++;
- else
- name_to_use = info.name;
+ name_to_use = info.name;
if (name_to_use[0] == 0 &&
info.array.level == LEVEL_CONTAINER &&
trustworthy == LOCAL) {
@@ -277,6 +273,12 @@ int Incremental(char *devname, int verbose, int runstop,
conf_name_is_free(name_to_use))
trustworthy = LOCAL;
+ /* strip "hostname:" prefix from name if we have decided
+ * to treat it as LOCAL
+ */
+ if (trustworthy == LOCAL && strchr(name_to_use, ':') != NULL)
+ name_to_use = strchr(name_to_use, ':')+1;
+
/* 4/ Check if array exists.
*/
map_lock(&map);