]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Incremental: fix 'name_to_use' in the container case
authorDan Williams <dan.j.williams@intel.com>
Wed, 25 Feb 2009 01:45:57 +0000 (18:45 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 25 Feb 2009 01:45:57 +0000 (18:45 -0700)
Just like the Assemble case, default to the text_version of the
container if another name is not specified.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Incremental.c

index 43b1f77638a2977e73126355591eabe8c4c5d615..0a0dc03762ee430151cf1d16b952ab91dc31683e 100644 (file)
@@ -226,6 +226,14 @@ int Incremental(char *devname, int verbose, int runstop,
        else
                name_to_use = info.name;
 
+       if ((!name_to_use || name_to_use[0] == 0) &&
+           info.array.level == LEVEL_CONTAINER &&
+           trustworthy == LOCAL) {
+               name_to_use = info.text_version;
+               trustworthy = METADATA;
+       }
+
+
        /* There are three possible sources for 'autof':  command line,
         * ARRAY line in mdadm.conf, or CREATE line in mdadm.conf.
         * ARRAY takes precedence, then command line, then
@@ -265,8 +273,7 @@ int Incremental(char *devname, int verbose, int runstop,
 
                /* Couldn't find an existing array, maybe make a new one */
                mdfd = create_mddev(match ? match->devname : NULL,
-                                   info.name, autof, trustworthy, chosen_name);
-
+                                   name_to_use, autof, trustworthy, chosen_name);
 
                if (mdfd < 0)
                        return 1;