From: Benjamin Marzinski Date: Tue, 9 Oct 2018 23:03:15 +0000 (-0500) Subject: libmultipath: Don't blank intialized paths X-Git-Tag: 0.7.8~2 X-Git-Url: https://git.opensvc.com/gitweb.cgi?p=multipath-tools%2F.git;a=commitdiff_plain;h=49a887ab8fa834bedc3c84f14bd03b9531b75062 libmultipath: Don't blank intialized paths 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 Signed-off-by: Benjamin Marzinski --- diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 301093f3..b267f07c 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -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; }