<div dir="ltr">Merged.<div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 4, 2017 at 2:15 PM, Guan Junxiong <span dir="ltr"><<a href="mailto:guanjunxiong@huawei.com" target="_blank">guanjunxiong@huawei.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In the hot-plug storage OS, if we tear down the target storage,<br>
there is a race between the path removing from the path list and<br>
handling the path-failed udev event. Therefore, we need to check<br>
null path before handle path-failed event.<br>
<br>
Signed-off-by: Guan Junxiong <<a href="mailto:guanjunxiong@huawei.com">guanjunxiong@huawei.com</a>><br>
---<br>
 multipathd/main.c | 10 ++++++----<br>
 1 file changed, 6 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/multipathd/main.c b/multipathd/main.c<br>
index 31ce923..84bb2c5 100644<br>
--- a/multipathd/main.c<br>
+++ b/multipathd/main.c<br>
@@ -1073,7 +1073,7 @@ uev_pathfail_check(struct uevent *uev, struct vectors *vecs)<br>
 {<br>
        char *action = NULL, *devt = NULL;<br>
        struct path *pp;<br>
-       int r;<br>
+       int r = 1;<br>
<br>
        action = uevent_get_dm_action(uev);<br>
        if (!action)<br>
@@ -1090,15 +1090,17 @@ uev_pathfail_check(struct uevent *uev, struct vectors *vecs)<br>
        lock(&vecs->lock);<br>
        pthread_testcancel();<br>
        pp = find_path_by_devt(vecs-><wbr>pathvec, devt);<br>
+    if (!pp)<br>
+        goto out_lock;<br>
        r = io_err_stat_handle_pathfail(<wbr>pp);<br>
-       lock_cleanup_pop(vecs->lock);<br>
-<br>
        if (r)<br>
                condlog(3, "io_err_stat: %s: cannot handle pathfail uevent",<br>
                                pp->dev);<br>
+out_lock:<br>
+       lock_cleanup_pop(vecs->lock);<br>
        FREE(devt);<br>
        FREE(action);<br>
-       return 0;<br>
+       return r;<br>
 out:<br>
        FREE(action);<br>
        return 1;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.6.4.windows.1<br>
<br>
<br>
</font></span></blockquote></div><br></div>