[dm-devel] [PATCH 3/3] libmultipath: don't enter recovery mode with pending paths

Benjamin Marzinski bmarzins at redhat.com
Thu Dec 23 01:32:35 UTC 2021


set_no_path_retry() could make a multipath device enter recovery mode
simply because its paths were still in the PATH_PENDING state.  This is
possible when a multipath device is first created. After commit 2e61b8fb
[libmultipath (coverity): Revert "setup_map: wait for pending path
checkers to finish"] it has become much more likely.

To avoid this, don't enter recovery mode as long as there are some paths
in PATH_PENDING.  Since path's can only be in this state if they've
never had their state checker finish, this change will only effect
recently created devices, whose checker hasn't completed yet.

Signed-off-by: Benjamin Marzinski <bmarzins at 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 f1031f61..6c23df86 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -616,7 +616,7 @@ void set_no_path_retry(struct multipath *mpp)
 			    !mpp->in_recovery)
 				dm_queue_if_no_path(mpp->alias, 1);
 			leave_recovery_mode(mpp);
-		} else
+		} else if (pathcount(mpp, PATH_PENDING) == 0)
 			enter_recovery_mode(mpp);
 		break;
 	}
-- 
2.17.2




More information about the dm-devel mailing list