summaryrefslogtreecommitdiffstats
path: root/Incremental.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-03-03 14:33:55 +1100
committerNeilBrown <neilb@suse.de>2010-03-03 14:33:55 +1100
commitd1d3482b562369b0d32e4267c2e245a3371d1f10 (patch)
tree72c0394196b102c9ec5782d5fdb80ba387ae43e7 /Incremental.c
parent5a9de8db047646e1e59d90afc478d1820736324d (diff)
downloadmdadm-d1d3482b562369b0d32e4267c2e245a3371d1f10.tar.gz
mdadm-d1d3482b562369b0d32e4267c2e245a3371d1f10.tar.xz
mdadm-d1d3482b562369b0d32e4267c2e245a3371d1f10.zip
config: add 'homehost' option to 'AUTO' line.
This allows basing auto-assembly decisions on whether the array is recorded as belonging to this host or not. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/Incremental.c b/Incremental.c
index 8c686f7..7ad648a 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -221,26 +221,30 @@ int Incremental(char *devname, int verbose, int runstop,
return 1;
}
- if (!match && !conf_test_metadata(st->ss->name)) {
- if (verbose >= 1)
- fprintf(stderr, Name
- ": %s has metadata type %s for which "
- "auto-assembly is disabled\n",
- devname, st->ss->name);
- return 1;
- }
-
/* 3a/ if not, check for homehost match. If no match, continue
* but don't trust the 'name' in the array. Thus a 'random' minor
* number will be assigned, and the device name will be based
* on that. */
if (match)
trustworthy = LOCAL;
- else if ((homehost == NULL ||
- st->ss->match_home(st, homehost) != 1) &&
- st->ss->match_home(st, "any") != 1)
- trustworthy = FOREIGN;
+ else if (st->ss->match_home(st, homehost) == 1)
+ trustworthy = LOCAL;
+ else if (st->ss->match_home(st, "any") == 1)
+ trustworthy = LOCAL_ANY;
else
+ trustworthy = FOREIGN;
+
+
+ if (!match && !conf_test_metadata(st->ss->name,
+ (trustworthy == LOCAL))) {
+ if (verbose >= 1)
+ fprintf(stderr, Name
+ ": %s has metadata type %s for which "
+ "auto-assembly is disabled\n",
+ devname, st->ss->name);
+ return 1;
+ }
+ if (trustworthy == LOCAL_ANY)
trustworthy = LOCAL;
/* There are three possible sources for 'autof': command line,