Make the restorequeueing command only do something if disablequeueing has first been run on the map. Also update the man page to explain what restorequeuing actually does. Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx> --- multipathd/cli_handlers.c | 40 ++++++++++++++++---------------------- multipathd/multipathd.8.in | 12 ++++++++++-- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index b1dff202..cf448b67 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -928,22 +928,15 @@ cli_restore_queueing(void *v, struct strbuf *reply, void *data) return 1; } - mpp->disable_queueing = 0; - conf = get_multipath_config(); - pthread_cleanup_push(put_multipath_config, conf); - select_no_path_retry(conf, mpp); - pthread_cleanup_pop(1); - - /* - * Don't call set_no_path_retry() for the NO_PATH_RETRY_FAIL case. - * That would disable queueing when "restorequeueing" is called, - * and the code never behaved that way. Users might not expect it. - * In almost all cases, queueing will be disabled anyway when we - * are here. - */ - if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF && - mpp->no_path_retry != NO_PATH_RETRY_FAIL) + if (mpp->disable_queueing) { + mpp->disable_queueing = 0; + conf = get_multipath_config(); + pthread_cleanup_push(put_multipath_config, conf); + select_no_path_retry(conf, mpp); + pthread_cleanup_pop(1); set_no_path_retry(mpp); + } else + condlog(2, "%s: queueing not disabled. Nothing to do", mapname); return 0; } @@ -957,15 +950,16 @@ cli_restore_all_queueing(void *v, struct strbuf *reply, void *data) condlog(2, "restore queueing (operator)"); vector_foreach_slot(vecs->mpvec, mpp, i) { - mpp->disable_queueing = 0; - struct config *conf = get_multipath_config(); - pthread_cleanup_push(put_multipath_config, conf); - select_no_path_retry(conf, mpp); - pthread_cleanup_pop(1); - /* See comment in cli_restore_queueing() */ - if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF && - mpp->no_path_retry != NO_PATH_RETRY_FAIL) + if (mpp->disable_queueing) { + mpp->disable_queueing = 0; + struct config *conf = get_multipath_config(); + pthread_cleanup_push(put_multipath_config, conf); + select_no_path_retry(conf, mpp); + pthread_cleanup_pop(1); set_no_path_retry(mpp); + } else + condlog(2, "%s: queueing not disabled. Nothing to do", + mpp->alias); } return 0; } diff --git a/multipathd/multipathd.8.in b/multipathd/multipathd.8.in index e98c27fd..f1cab3ff 100644 --- a/multipathd/multipathd.8.in +++ b/multipathd/multipathd.8.in @@ -251,7 +251,11 @@ Disable queueing on all multipath devices. . .TP .B restorequeueing maps|multipaths -Restore queueing on all multipath devices. +Restore queueing to the configured \fIno_path_retry\fR setting on all multipath +devices whose queueing has been previously disabled by the \fIdisablequeueing\fR +command. \fBNote:\fR If \fIno_path_path_retry\fR is set to queue for a limited +number of retries after all paths have failed, this will not enable queueing if +there are no active paths. . .TP .B disablequeueing map|multipath $map @@ -259,7 +263,11 @@ Disable queuing on multipathed map $map. . .TP .B restorequeueing map|multipath $map -Restore queuing on multipahted map $map. +restore queueing to the configured \fIno_path_retry\fR setting on multipathed +map $map whose queueing has been previously disabled by the +\fIdisablequeueing\fR command. \fBNote:\fR If \fIno_path_path_retry\fR is set to +queue for a limited number of retries after all paths have failed, this will not +enable queueing if there are no active paths. . .TP .B forcequeueing daemon -- 2.41.0