[dm-devel] [PATCH 04/11] Fix inconsistent entries after merging hwtable with user's config

Hannes Reinecke hare at suse.de
Thu Jan 17 14:59:26 UTC 2013


From: Petr Uzel <petr.uzel at suse.cz>

When merging the user provided configuration with the internal
hwtable entry in merge_hwe(), it can happen that the resulting
entry has a discrepancy between 'features' and 'no_path_retry'.
Check for this special case and fix it.

Signed-off-by: Petr Uzel <petr.uzel at suse.cz>
---
 libmultipath/config.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libmultipath/config.c b/libmultipath/config.c
index b317e32..2d88226 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -335,6 +335,15 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
 	merge_num(retain_hwhandler);
 	merge_num(detect_prio);
 
+	/*
+	 * Make sure features is consistent with
+	 * no_path_retry
+	 */
+	if (dst->no_path_retry == NO_PATH_RETRY_FAIL)
+		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");
+
 	return 0;
 }
 
-- 
1.7.10.4




More information about the dm-devel mailing list