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")
Signed-off-by: Benjamin Marzinski <[email protected]>
---
 libmultipath/configure.c   | 14 ++------------
 libmultipath/structs_vec.c |  3 +--
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index a713ddc4..a954ca31 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -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;
 
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 3e63e9c3..9384de01 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -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 &&
-- 
2.50.1


Reply via email to