adopt_paths() is generally called when you are planning on creating or
reloading a multipath device. The only time when adopt_paths() is called
and mpp->action isn't explicitly set to ACT_CREATE or ACT_RELOAD
afterwards is when it is called by coalesce_paths() ->
add_map_with_path(). But in this case, you will only set need_reload if
the path that is being adopted isn't already part of the device. Because
of that, the new device that's being assembled in coalesce_paths() must
be different from the existing device (it has a path that isn't in the
existing device), so select_action() will select ACT_RELOAD, regardless
of the need_reload state. This makes intuitive sense. When multipath
adopts a new path, it should reload the device to actually add that path
to the device.

Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com>
---
 libmultipath/structs_vec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index f5860499..47fc7cf3 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -349,7 +349,7 @@ int adopt_paths(vector pathvec, struct multipath *mpp,
                                 */
                                if (!current_mpp ||
                                    !mp_find_path_by_devt(current_mpp, 
pp->dev_t))
-                                       mpp->need_reload = 
set_path_max_sectors_kb(pp, mpp->max_sectors_kb) || mpp->need_reload;
+                                       set_path_max_sectors_kb(pp, 
mpp->max_sectors_kb);
                        }
 
                        pp->mpp = mpp;
-- 
2.46.2


Reply via email to