Skip to contentSkip to conversation

multipathd: fix failures on booting from a multipath device

PATCH New Benjamin Marzinski 1 participant 1 message Feb 5 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 1/1 multipathd: fix failures on booting from a multipath device

Commit a04be557 ("multipathd: don't add removed/partial paths to new maps") stopped including INIT_PARTIAL paths in the updated multipath devices built during reconfigure(). During normal multipath operation this does make sense, but isn't necessary (the uevent should still come shortly) and the situation is very unlikely to occur. On the other hand, when multipathd starts up after the pivot root during boot, it's very possible that paths will not be fully initialized. Multipathd should not drops paths in this case. The patch mostly reverts a04be557.

Paths that are marked as INIT_REMOVED shouldn't be added in coalesce_paths(). adopt_paths() was already making sure that they weren't before a04be557. But it does make sense to catch those paths earlier in coalesce_paths(), so this patch retains that behavior.

Fixes a04be557 ("multipathd: don't add removed/partial paths to new maps")
---
 libmultipath/configure.c   | 14 ++------------
 libmultipath/structs_vec.c |  3 +--
 2 files changed, 3 insertions(+), 14 deletions(-)
libmultipath/configure.c +2 -12
index a713ddc4..a954ca31 100644
@@ -1108,22 +1108,12 @@ int coalesce_paths (struct vectors *vecs, vector mpvec, char *refwwid,
 			continue;
 
 		/* 3. if path has disappeared */
-		if (pp1->state == PATH_REMOVED) {
+		if (pp1->state == PATH_REMOVED || pp1->initialized == INIT_REMOVED) {
 			orphan_path(pp1, "path removed");
 			continue;
 		}
 
-		/*
-		 * 4. The path wasn't found in path_discovery. It only exists
-		 *    in an old map.
-		 */
-		if (pp1->initialized == INIT_PARTIAL ||
-		    pp1->initialized == INIT_REMOVED) {
-			orphan_path(pp1, "path not found");
-			continue;
-		}
-
-		/* 5. path is out of scope */
+		/* 4. path is out of scope */
 		if (refwwid && strncmp(pp1->wwid, refwwid, WWID_SIZE - 1))
 			continue;
 
libmultipath/structs_vec.c +1 -2
index 3e63e9c3..9384de01 100644
@@ -315,8 +315,7 @@ int adopt_paths(vector pathvec, struct multipath *mpp,
 					pp->dev, mpp->alias);
 				continue;
 			}
-			if (pp->initialized == INIT_REMOVED ||
-			    pp->initialized == INIT_PARTIAL)
+			if (pp->initialized == INIT_REMOVED)
 				continue;
 			if (mpp->queue_mode == QUEUE_MODE_RQ &&
 			    pp->bus == SYSFS_BUS_NVME &&
Signature · 1 line
2.50.1