summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-05-11 15:46:46 +1000
committerNeilBrown <neilb@suse.de>2009-05-11 15:46:46 +1000
commit0ac91628b93b31636979b637c1ac7258064dea4e (patch)
tree88971a9e037c1519a8db205e8d6d1338ddfe8131 /Assemble.c
parent603f24a05f48063a7239e323e2aeab497cb0feb6 (diff)
downloadmdadm-0ac91628b93b31636979b637c1ac7258064dea4e.tar.gz
mdadm-0ac91628b93b31636979b637c1ac7258064dea4e.tar.xz
mdadm-0ac91628b93b31636979b637c1ac7258064dea4e.zip
Allow homehost to be largely ignored when assembling arrays.
If mdadm.conf contains HOMEHOST <ignore> or commandline contains --homehost=<ignore> then the check that array metadata mentions the given homehost is replace by a check that the name recorded in the metadata is not already used by some other array mentioned in mdadm.conf. This allows more arrays to use their native name rather than having an _NN suffix added. This should only be used during boot time if all arrays required for normal boot are listed in mdadm.conf. If auto-assembly is used to find all array during boot, then the HOMEHOST feature should be used to ensure there is no room for confusion in choosing array names, and so it should not be set to <ignore>. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index c079f6b..2c52f07 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -79,7 +79,7 @@ int Assemble(struct supertype *st, char *mddev,
mddev_ident_t ident,
mddev_dev_t devlist, char *backup_file,
int readonly, int runstop,
- char *update, char *homehost,
+ char *update, char *homehost, int require_homehost,
int verbose, int force)
{
/*
@@ -509,6 +509,12 @@ int Assemble(struct supertype *st, char *mddev,
name = content->text_version;
trustworthy = METADATA;
}
+
+ if (name[0] && trustworthy != LOCAL &&
+ ! require_homehost &&
+ conf_name_is_free(name))
+ trustworthy = LOCAL;
+
mdfd = create_mddev(mddev, name, ident->autof, trustworthy,
chosen_name);
if (mdfd < 0) {