[dm-devel] [PATCH 05/10] mpath: don't wait for udev if all paths are down

Benjamin Marzinski bmarzins at redhat.com
Sat Oct 29 02:55:21 UTC 2016


Normally multipath waits for udev to create a device before adding
more paths, which could trigger a reload. But, if the first path
discovered is not usable, you should add the next path right away.

Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 multipathd/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index dbcaa03..15c957a 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -715,7 +715,10 @@ ev_add_path (struct path * pp, struct vectors * vecs)
 		goto fail; /* leave path added to pathvec */
 	}
 	mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid);
-	if (mpp && mpp->wait_for_udev) {
+	if (mpp && mpp->wait_for_udev &&
+	    (pathcount(mpp, PATH_UP) > 0 ||
+	     (pathcount(mpp, PATH_GHOST) > 0 && pp->tpgs != TPGS_IMPLICIT))) {
+		/* if wait_for_udev is set and valid paths exist */
 		mpp->wait_for_udev = 2;
 		orphan_path(pp, "waiting for create to complete");
 		return 0;
-- 
1.8.3.1




More information about the dm-devel mailing list