Linux Device Mapper development
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	Hannes Reinecke <hare@suse.de>
Cc: dm-devel@redhat.com, Xose Vazquez Perez <xose.vazquez@gmail.com>
Subject: [PATCH 4/7] libmultipath: merge_hwe: fix queue_if_no_path logic
Date: Wed, 14 Jun 2017 00:55:51 +0200	[thread overview]
Message-ID: <20170613225554.11181-5-mwilck@suse.com> (raw)
In-Reply-To: <20170613225554.11181-1-mwilck@suse.com>

The logic applied here should match the logic in select_features().
If no_path_retry is anything but "undef", queue_if_no_path can be
removed from the feature string, assemble_map() will infer it
correctly.
The case where no_path_retry is undefined and "queue_if_no_path"
is set is treated as if "no_path_retry queue" had been set.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/config.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/libmultipath/config.c b/libmultipath/config.c
index 61bbba91..b928fbe7 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -355,12 +355,24 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
 
 	/*
 	 * Make sure features is consistent with
-	 * no_path_retry
+	 * no_path_retry.
+	 * The logic should be consistent with select_features().
+	 * The actual queue_if_no_path feature is set in assemble_map().
 	 */
-	if (dst->no_path_retry == NO_PATH_RETRY_FAIL)
+	if (dst->no_path_retry == NO_PATH_RETRY_UNDEF &&
+	    strstr(dst->features, "queue_if_no_path")) {
+		condlog(3, "%s/%s: 'queue_if_no_path' is set, assuming no_path_retry='queue'",
+			dst->vendor, dst->product);
+		dst->no_path_retry = NO_PATH_RETRY_QUEUE;
+	}
+	else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF) {
+		condlog(3, "%s/%s: 'no_path_retry' is set, ignoring 'queue_if_no_path'",
+			dst->vendor, dst->product);
 		remove_feature(&dst->features, "queue_if_no_path");
-	else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF)
-		add_feature(&dst->features, "queue_if_no_path");
+	}
+
+	if (dst->retain_hwhandler != RETAIN_HWHANDLER_UNDEF)
+		remove_feature(&dst->features, "retain_attached_hw_handler");
 
 	return 0;
 }
-- 
2.13.0

  parent reply	other threads:[~2017-06-13 22:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 22:55 [PATCH 0/7] no_path_retry/queue_if_no_path logic & logging/man page fixes Martin Wilck
2017-06-13 22:55 ` [PATCH 1/7] libmultipath: load_config: skip setting unnecessary defaults Martin Wilck
2017-06-15 19:49   ` Benjamin Marzinski
2017-06-13 22:55 ` [PATCH 2/7] libmultipath: add/remove_feature: use const char* for feature Martin Wilck
2017-06-13 22:55 ` [PATCH 3/7] libmultipath: clarify option conflicts for "features" Martin Wilck
2017-06-15 19:54   ` Benjamin Marzinski
2017-06-19 20:41     ` Martin Wilck
2017-06-13 22:55 ` Martin Wilck [this message]
2017-06-15 19:55   ` [PATCH 4/7] libmultipath: merge_hwe: fix queue_if_no_path logic Benjamin Marzinski
2017-06-13 22:55 ` [PATCH 5/7] libmultipath: assemble_map: " Martin Wilck
2017-06-13 22:55 ` [PATCH 6/7] multipath.conf.5: document no_path_retry vs. queue_if_no_path Martin Wilck
2017-06-15 19:57   ` Benjamin Marzinski
2017-06-13 22:55 ` [PATCH 7/7] multipath.conf.5: Remove ??? and other minor fixes Martin Wilck
2017-06-15 19:46 ` [PATCH 0/7] no_path_retry/queue_if_no_path logic & logging/man page fixes Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170613225554.11181-5-mwilck@suse.com \
    --to=mwilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=xose.vazquez@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox