summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-05-11 15:47:10 +1000
committerNeilBrown <neilb@suse.de>2009-05-11 15:47:10 +1000
commit7cdc0872342e8834f224132867ea88ee04e050bf (patch)
treed372fa52b023528c2069607753bce302700c636e /Assemble.c
parent5c4c9ab16d7db67c660570c354e9e75fb6e20ecc (diff)
downloadmdadm-7cdc0872342e8834f224132867ea88ee04e050bf.tar.gz
mdadm-7cdc0872342e8834f224132867ea88ee04e050bf.tar.xz
mdadm-7cdc0872342e8834f224132867ea88ee04e050bf.zip
Be more consistent about keeping the host: prefix on array names.
If an array name contains a "hostname:" prefix, then --assemble will tend to leave it there, while --incremental will strip it off (when chosing a device name during auto-assembly). Make this more consistent: strip the name off if we decide that the name will be treated as 'local'. Leave it on if it will be treated as 'foreign'. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c5
1 files changed, 5 insertions, 0 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) {