libmultipath: Don't blank intialized paths
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 9 Oct 2018 23:03:15 +0000 (18:03 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 10 Oct 2018 06:09:48 +0000 (08:09 +0200)
When pathinfo fails for some likely transient reason, it clears the path
wwid, but otherwise returns successfully, to keep the path around but
not usable until it gets fully initialized. However, if the path has
already been initialized, and pathinfo hits a transient error, it
shouldn't clear the wwid.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/discovery.c

index 301093f..b267f07 100644 (file)
@@ -2004,9 +2004,9 @@ blank:
        /*
         * Recoverable error, for example faulty or offline path
         */
-       memset(pp->wwid, 0, WWID_SIZE);
        pp->chkrstate = pp->state = PATH_DOWN;
-       pp->initialized = INIT_FAILED;
+       if (pp->initialized == INIT_FAILED)
+               memset(pp->wwid, 0, WWID_SIZE);
 
        return PATHINFO_OK;
 }