From: NeilBrown Date: Tue, 10 Mar 2009 05:28:22 +0000 (+1100) Subject: Incremental/container: don't create when we should just be opening. X-Git-Tag: mdadm-3.0-devel3~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3092660000d462965b816ce3e7e0ff8b4802b215;p=thirdparty%2Fmdadm.git Incremental/container: don't create when we should just be opening. When incr-assembling in a container, if the array already exists, don't try to create it again, just open it. Signed-off-by: NeilBrown --- diff --git a/Incremental.c b/Incremental.c index f8a5d326..99fc1bfc 100644 --- a/Incremental.c +++ b/Incremental.c @@ -733,7 +733,10 @@ int Incremental_container(struct supertype *st, char *devname, int verbose, mp = map_by_uuid(&map, ra->uuid); - if (!mp) { + if (mp) { + mdfd = open_dev(mp->devnum); + strcpy(chosen_name, mp->path); + } else { /* Check in mdadm.conf for devices == devname and * member == ra->text_version after second slash. @@ -772,13 +775,13 @@ int Incremental_container(struct supertype *st, char *devname, int verbose, array_list->member); break; } - } - mdfd = create_mddev(match ? match->devname : NULL, - ra->name, - autof, - trustworthy, - chosen_name); + mdfd = create_mddev(match ? match->devname : NULL, + ra->name, + autof, + trustworthy, + chosen_name); + } if (mdfd < 0) { fprintf(stderr, Name ": failed to open %s: %s.\n",