[dm-devel] [PATCH 1/2] libmpathpersist: use conf->timeout for updating persistent reservations

mwilck at suse.com mwilck at suse.com
Fri Jan 13 09:43:09 UTC 2023


From: Martin Wilck <mwilck at suse.com>

On systems with many LUNs, multipathd may fail to respond within the
default timeout to a "setprkey" command because the vecs lock is held
by the path checker. Honor the globally configured uxsock timeout in
libmpathpersist.

Reported-by: boposki (github.com/opensvc/multipath-tools/pull/58)
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 libmpathpersist/mpath_updatepr.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libmpathpersist/mpath_updatepr.c b/libmpathpersist/mpath_updatepr.c
index 4529a82..36bd777 100644
--- a/libmpathpersist/mpath_updatepr.c
+++ b/libmpathpersist/mpath_updatepr.c
@@ -14,6 +14,9 @@
 #include <mpath_persist.h>
 #include "debug.h"
 #include "mpath_cmd.h"
+#include "vector.h"
+#include "globals.h"
+#include "config.h"
 #include "uxsock.h"
 #include "mpathpr.h"
 
@@ -24,6 +27,12 @@ static int do_update_pr(char *alias, char *cmd, char *key)
 	char str[256];
 	char *reply;
 	int ret = 0;
+	int timeout;
+	struct config *conf;
+
+	conf = get_multipath_config();
+	timeout = conf->uxsock_timeout;
+	put_multipath_config(conf);
 
 	fd = mpath_connect();
 	if (fd == -1) {
@@ -41,7 +50,7 @@ static int do_update_pr(char *alias, char *cmd, char *key)
 		mpath_disconnect(fd);
 		return -1;
 	}
-	ret = recv_packet(fd, &reply, DEFAULT_REPLY_TIMEOUT);
+	ret = recv_packet(fd, &reply, timeout);
 	if (ret < 0) {
 		condlog(2, "%s: message=%s recv error=%d", alias, str, errno);
 		ret = -1;
-- 
2.39.0



More information about the dm-devel mailing list