]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: don't check for pre-existing array when updating uuid.
authorNeilBrown <neilb@suse.de>
Wed, 13 May 2015 02:41:48 +0000 (12:41 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 13 May 2015 02:41:48 +0000 (12:41 +1000)
This is a very corner-case, but the self-tests tripped on it,
and it makes sense not to trust the uuid when it is being changed.

Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c

index 25a103d846aed16dbfd4097d16154511575f6399..42710a8a2dac9d1126637c748fce7232f550d6a4 100644 (file)
@@ -1348,7 +1348,10 @@ try_again:
         */
        if (map_lock(&map))
                pr_err("failed to get exclusive lock on mapfile - continue anyway...\n");
-       mp = map_by_uuid(&map, content->uuid);
+       if (c->update && strcmp(c->update,"uuid") == 0)
+               mp = NULL;
+       else
+               mp = map_by_uuid(&map, content->uuid);
        if (mp) {
                struct mdinfo *dv;
                /* array already exists. */