From e12e1d1d6abd79bbc3406a78149db8732c0c8dd6 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 24 Feb 2009 18:45:57 -0700 Subject: [PATCH] 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 --- Incremental.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; -- 2.39.2