<div dir="ltr">Merged.<div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 1, 2016 at 11:46 PM, Benjamin Marzinski <span dir="ltr"><<a href="mailto:bmarzins@redhat.com" target="_blank">bmarzins@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">multipathd has code to finish gathering the information of paths that<br>
were not active at the time they were discovered. When the checker loop<br>
goes to check a path, and notices that it wasn't fully initialized, it<br>
is supposed to complete the initialization.  However the code is broken.<br>
This means that if you reconfigure multipathd while paths are down, they<br>
will no longer be usable. This patch makes sure that check_path will<br>
actually rerun pathinfo to finish setting up the path, so that after the<br>
path comes back up, it will be usable again.<br>
<br>
Signed-off-by: Benjamin Marzinski <<a href="mailto:bmarzins@redhat.com">bmarzins@redhat.com</a>><br>
---<br>
 libmultipath/discovery.c |  5 +++--<br>
 multipathd/main.c        | 20 ++++++++++++++++----<br>
 2 files changed, 19 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c<br>
index d5215f9..eb2e926 100644<br>
--- a/libmultipath/discovery.c<br>
+++ b/libmultipath/discovery.c<br>
@@ -1713,8 +1713,9 @@ pathinfo (struct path *pp, struct config *conf, int mask)<br>
                        get_prio(pp);<br>
                }<br>
        }<br>
-<br>
-       pp->initialized = INIT_OK;<br>
+<br>
+       if ((mask & DI_ALL) == DI_ALL)<br>
+               pp->initialized = INIT_OK;<br>
        return PATHINFO_OK;<br>
<br>
 blank:<br>
diff --git a/multipathd/main.c b/multipathd/main.c<br>
index 9682b3e..6e3ae69 100644<br>
--- a/multipathd/main.c<br>
+++ b/multipathd/main.c<br>
@@ -1439,7 +1439,8 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)<br>
 }<br>
<br>
 /*<br>
- * Returns '1' if the path has been checked, '0' otherwise<br>
+ * Returns '1' if the path has been checked, '-1' if it was blacklisted<br>
+ * and '0' otherwise<br>
  */<br>
 int<br>
 check_path (struct vectors * vecs, struct path * pp, int ticks)<br>
@@ -1452,6 +1453,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)<br>
        int oldchkrstate = pp->chkrstate;<br>
        int retrigger_tries, checkint;<br>
        struct config *conf;<br>
+       int ret;<br>
<br>
        if ((pp->initialized == INIT_OK ||<br>
             pp->initialized == INIT_REQUESTED_UDEV) && !pp->mpp)<br>
@@ -1511,10 +1513,14 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)<br>
                    (newstate == PATH_UP || newstate == PATH_GHOST)) {<br>
                        condlog(2, "%s: add missing path", pp->dev);<br>
                        conf = get_multipath_config();<br>
-                       if (pathinfo(pp, conf, DI_ALL) == 0) {<br>
+                       ret = pathinfo(pp, conf, DI_ALL | DI_BLACKLIST);<br>
+                       if (ret == PATHINFO_OK) {<br>
                                ev_add_path(pp, vecs);<br>
                                pp->tick = 1;<br>
-                       }<br>
+                       } else if (ret == PATHINFO_SKIPPED) {<br>
+                               put_multipath_config(conf);<br>
+                               return -1;<br>
+                       }<br>
                        put_multipath_config(conf);<br>
                }<br>
                return 0;<br>
@@ -1779,7 +1785,13 @@ checkerloop (void *ap)<br>
                        lock(vecs->lock);<br>
                        pthread_testcancel();<br>
                        vector_foreach_slot (vecs->pathvec, pp, i) {<br>
-                               num_paths += check_path(vecs, pp, ticks);<br>
+                               rc = check_path(vecs, pp, ticks);<br>
+                               if (rc < 0) {<br>
+                                       vector_del_slot(vecs->pathvec, i);<br>
+                                       free_path(pp);<br>
+                                       i--;<br>
+                               } else;<br>
+                                       num_paths += rc;<br>
                        }<br>
                        lock_cleanup_pop(vecs->lock);<br>
                }<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
</font></span></blockquote></div><br></div>