[PATCH 3/7] multipathd: refresh multipath before calling set_no_path_retry()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure that all callers of set_no_path_retry() update the
multipath->features string from the kernel before calling it, so that
they have the current queueing state to check.

Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
---
 multipathd/cli_handlers.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 117570e1..3dc5e690 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -934,6 +934,8 @@ cli_restore_queueing(void *v, struct strbuf *reply, void *data)
 		pthread_cleanup_push(put_multipath_config, conf);
 		select_no_path_retry(conf, mpp);
 		pthread_cleanup_pop(1);
+		if (refresh_multipath(vecs, mpp))
+			return -ENODEV;
 		set_no_path_retry(mpp);
 	} else
 		condlog(2, "%s: queueing not disabled. Nothing to do", mapname);
@@ -956,6 +958,10 @@ cli_restore_all_queueing(void *v, struct strbuf *reply, void *data)
 			pthread_cleanup_push(put_multipath_config, conf);
 			select_no_path_retry(conf, mpp);
 			pthread_cleanup_pop(1);
+			if (refresh_multipath(vecs, mpp)) {
+				i--;
+				continue;
+			}
 			set_no_path_retry(mpp);
 		} else
 			condlog(2, "%s: queueing not disabled. Nothing to do",
@@ -983,6 +989,8 @@ cli_disable_queueing(void *v, struct strbuf *reply, void *data)
 	mpp->retry_tick = 0;
 	mpp->no_path_retry = NO_PATH_RETRY_FAIL;
 	mpp->disable_queueing = 1;
+	if (refresh_multipath(vecs, mpp))
+		return -ENODEV;
 	set_no_path_retry(mpp);
 	return 0;
 }
@@ -1001,6 +1009,10 @@ cli_disable_all_queueing(void *v, struct strbuf *reply, void *data)
 		mpp->retry_tick = 0;
 		mpp->no_path_retry = NO_PATH_RETRY_FAIL;
 		mpp->disable_queueing = 1;
+		if (refresh_multipath(vecs, mpp)) {
+			i--;
+			continue;
+		}
 		set_no_path_retry(mpp);
 	}
 	return 0;
-- 
2.45.0





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux