]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
assemble: support arrays created with --homehost=any
authorNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:16:49 +0000 (15:16 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 11 May 2009 05:16:49 +0000 (15:16 +1000)
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 <neilb@suse.de>
Assemble.c
Incremental.c

index 4cf5405890ea35306d8940691f97e60064bab0a1..47b8839e4835df1cf7461df07f6641e9ce577c3c 100644 (file)
@@ -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;
index f7e602ec4e697b31b0cbf0dfa081f902e507fcb1..c13ea43fb385f7acbc0c8ae2b1baca376e05cfa7 100644 (file)
@@ -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;