summaryrefslogtreecommitdiffstats
path: root/Incremental.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 /Incremental.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 'Incremental.c')
-rw-r--r--Incremental.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Incremental.c b/Incremental.c
index 8908eec..c5ec634 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -37,7 +37,8 @@ static void find_reject(int mdfd, struct supertype *st, struct mdinfo *sra,
char *array_name);
int Incremental(char *devname, int verbose, int runstop,
- struct supertype *st, char *homehost, int autof)
+ struct supertype *st, char *homehost, int require_homehost,
+ int autof)
{
/* Add this device to an array, creating the array if necessary
* and starting the array if sensible or - if runstop>0 - if possible.
@@ -265,12 +266,16 @@ int Incremental(char *devname, int verbose, int runstop,
else
name_to_use = info.name;
- if ((!name_to_use || name_to_use[0] == 0) &&
+ if (name_to_use[0] == 0 &&
info.array.level == LEVEL_CONTAINER &&
trustworthy == LOCAL) {
name_to_use = info.text_version;
trustworthy = METADATA;
}
+ if (name_to_use[0] && trustworthy != LOCAL &&
+ ! require_homehost &&
+ conf_name_is_free(name_to_use))
+ trustworthy = LOCAL;
/* 4/ Check if array exists.
*/
@@ -424,7 +429,7 @@ int Incremental(char *devname, int verbose, int runstop,
if (runstop < 0)
return 0; /* don't try to assemble */
rv = Incremental(chosen_name, verbose, runstop,
- NULL, homehost, autof);
+ NULL, homehost, require_homehost, autof);
if (rv == 1)
/* Don't fail the whole -I if a subarray didn't
* have enough devices to start yet