pp->state should only be set to PATH_PENDING if it is currently in
the PATH_UNCHECKED or PATH_WILD states. Otherwise, it should retain
its current state.  Fix this in pathinfo() calls with DI_NOIO, to
match with the rest of the code.

Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com>
---
 libmultipath/discovery.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 7d939ae0..6e5d1005 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -2345,7 +2345,10 @@ int pathinfo(struct path *pp, struct config *conf, int 
mask)
                         * Avoid any IO on the device itself.
                         * simply use the path_offline() return as its state
                         */
-                       pp->chkrstate = pp->state = path_state;
+                       if (path_state != PATH_PENDING ||
+                           pp->state == PATH_UNCHECKED ||
+                           pp->state == PATH_WILD)
+                               pp->chkrstate = pp->state = path_state;
                return PATHINFO_OK;
        }
 
-- 
2.17.2

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to