From: Dan Williams Date: Wed, 25 Feb 2009 01:45:57 +0000 (-0700) Subject: Incremental: fix 'name_to_use' in the container case X-Git-Tag: mdadm-3.0-devel3~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e12e1d1d6abd79bbc3406a78149db8732c0c8dd6;p=thirdparty%2Fmdadm.git Incremental: fix 'name_to_use' in the container case Just like the Assemble case, default to the text_version of the container if another name is not specified. Signed-off-by: Dan Williams --- diff --git a/Incremental.c b/Incremental.c index 43b1f776..0a0dc037 100644 --- a/Incremental.c +++ b/Incremental.c @@ -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;