diff options
author | NeilBrown <neilb@suse.de> | 2008-09-18 16:06:41 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-09-18 16:06:41 +1000 |
commit | 9362c1c80c4464fb66e3cc9eb8ba7631f21810d7 (patch) | |
tree | 795cd9ce0c0c7c6c787c11844e062c32c8a23c66 | |
parent | ffcfc735a5114290cb6b3063c8a5fddddc384a36 (diff) |
Allow metadata handler to report that it doesn't record homehost.
For now, this means that the lack of a homehost doesn't always prevent
assembly.
Soon we will allow assembly anyway, but have different messages if
homehost isn't supported.
-rw-r--r-- | Assemble.c | 3 | ||||
-rw-r--r-- | Incremental.c | 2 | ||||
-rw-r--r-- | mdadm.h | 3 | ||||
-rw-r--r-- | super-intel.c | 2 |
4 files changed, 5 insertions, 5 deletions
@@ -339,7 +339,8 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, if (homehost) { int first = st->ss->match_home(st, homehost); int last = tst->ss->match_home(tst, homehost); - if (first+last == 1) { + if (first != last && + (first == 1 || last == 1)) { /* We can do something */ if (first) {/* just ignore this one */ if ((inargv && verbose >= 0) || verbose > 0) diff --git a/Incremental.c b/Incremental.c index d7eeafc1..f57c9bb1 100644 --- a/Incremental.c +++ b/Incremental.c @@ -217,7 +217,7 @@ int Incremental(char *devname, int verbose, int runstop, /* 3a/ if not, check for homehost match. If no match, reject. */ if (!match) { if (homehost == NULL || - st->ss->match_home(st, homehost) == 0) { + st->ss->match_home(st, homehost) != 1) { if (verbose >= 0) fprintf(stderr, Name ": not found in mdadm.conf and not identified by homehost.\n"); @@ -446,8 +446,7 @@ extern struct superswitch { void (*getinfo_super)(struct supertype *st, struct mdinfo *info); /* Check if the given metadata is flagged as belonging to "this" - * host. For arrays that don't determine a minor-number, this - * can always be true (??) + * host. 0 for 'no', 1 for 'yes', -1 for "Don't record homehost" */ int (*match_home)(struct supertype *st, char *homehost); diff --git a/super-intel.c b/super-intel.c index ff86e094..f632bcfe 100644 --- a/super-intel.c +++ b/super-intel.c @@ -578,7 +578,7 @@ static int match_home_imsm(struct supertype *st, char *homehost) { printf("%s\n", __FUNCTION__); - return 0; + return -1; } static void uuid_from_super_imsm(struct supertype *st, int uuid[4]) |