File multipath-tools-set-queue_if_no_path-during-map-reload of Package multipath-tools

From 0f14a248c1e1b0320ea86bbd385647e74db6dc73 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 4 Feb 2009 11:25:43 +0100
Subject: [PATCH] Set queue_if_no_path during map reload

multipath has two different ways of specifying queue_if_no_path:
Setting it as a 'feature' and specifying 'no_path_retry' setting.
Difference is that the latter will be enabled _after_ a map reload,
leaving a race window during which queue_if_no_path is effectively
disabled.

References: bnc#472253

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 libmultipath/dmparser.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
index 91fcda0..98e8d7c 100644
--- a/libmultipath/dmparser.c
+++ b/libmultipath/dmparser.c
@@ -52,7 +52,8 @@ assemble_map (struct multipath * mp, char * params, int len)
 	int i, j;
 	int shift, freechar;
 	int minio;
-	char * p;
+	char * p, * f;
+	char no_path_retry[] = "1 queue_if_no_path";
 	struct pathgroup * pgp;
 	struct path * pp;
 
@@ -60,8 +61,13 @@ assemble_map (struct multipath * mp, char * params, int len)
 	p = params;
 	freechar = len;
 
+	if ((mp->features[0] == '0') && (mp->no_path_retry == NO_PATH_RETRY_QUEUE))
+		f = no_path_retry;
+	else
+		f = mp->features;
+
 	shift = snprintf(p, freechar, "%s %s %i %i",
-			 mp->features, mp->hwhandler,
+			 f, mp->hwhandler,
 			 VECTOR_SIZE(mp->pg), mp->bestpg);
 
 	if (shift >= freechar) {
-- 
1.6.0.2

openSUSE Build Service is sponsored by