From: NeilBrown Date: Mon, 11 May 2009 05:16:49 +0000 (+1000) Subject: assemble: support arrays created with --homehost=any X-Git-Tag: mdadm-3.0-rc1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=745f72f61ab363dbc1c19fd00cc29edc42571f62;p=thirdparty%2Fmdadm.git assemble: support arrays created with --homehost=any If an array is created with --homehost=any, then --assemble and --incremental will treat it as being local to 'this' host, no matter what the name of this host is. This is useful for array that will be given unique names and be moved between machines. This needs to be documented. Signed-off-by: NeilBrown --- diff --git a/Assemble.c b/Assemble.c index 4cf54058..47b8839e 100644 --- a/Assemble.c +++ b/Assemble.c @@ -478,7 +478,8 @@ int Assemble(struct supertype *st, char *mddev, st->ss->getinfo_super(st, content); trustworthy = FOREIGN; - switch (st->ss->match_home(st, homehost)) { + switch (st->ss->match_home(st, homehost) + ?: st->ss->match_home(st, "any")) { case 0: trustworthy = FOREIGN; name = content->name; diff --git a/Incremental.c b/Incremental.c index f7e602ec..c13ea43f 100644 --- a/Incremental.c +++ b/Incremental.c @@ -217,8 +217,9 @@ int Incremental(char *devname, int verbose, int runstop, * on that. */ if (match) trustworthy = LOCAL; - else if (homehost == NULL || - st->ss->match_home(st, homehost) != 1) + else if ((homehost == NULL || + st->ss->match_home(st, homehost) != 1) && + st->ss->match_home(st, "any") != 1) trustworthy = FOREIGN; else trustworthy = LOCAL;