Blame SOURCES/0259-RHBZ-1701604-fix-nr-active.patch

0fe00a
---
0fe00a
 libmultipath/structs_vec.c |   24 +++++++++++++++++-------
0fe00a
 multipathd/main.c          |    2 ++
0fe00a
 2 files changed, 19 insertions(+), 7 deletions(-)
0fe00a
0fe00a
Index: multipath-tools-130222/libmultipath/structs_vec.c
0fe00a
===================================================================
0fe00a
--- multipath-tools-130222.orig/libmultipath/structs_vec.c
0fe00a
+++ multipath-tools-130222/libmultipath/structs_vec.c
0fe00a
@@ -312,24 +312,33 @@ update_multipath_strings (struct multipa
0fe00a
 extern void
0fe00a
 set_no_path_retry(struct multipath *mpp)
0fe00a
 {
0fe00a
-	mpp->retry_tick = 0;
0fe00a
+	char is_queueing = 0;
0fe00a
+
0fe00a
 	mpp->nr_active = pathcount(mpp, PATH_UP) + pathcount(mpp, PATH_GHOST);
0fe00a
-	select_no_path_retry(mpp);
0fe00a
+	if (mpp->features && strstr(mpp->features, "queue_if_no_path"))
0fe00a
+		is_queueing = 1;
0fe00a
 
0fe00a
 	switch (mpp->no_path_retry) {
0fe00a
 	case NO_PATH_RETRY_UNDEF:
0fe00a
 		break;
0fe00a
 	case NO_PATH_RETRY_FAIL:
0fe00a
-		dm_queue_if_no_path(mpp->alias, 0);
0fe00a
+		if (is_queueing)
0fe00a
+			dm_queue_if_no_path(mpp->alias, 0);
0fe00a
 		break;
0fe00a
 	case NO_PATH_RETRY_QUEUE:
0fe00a
-		dm_queue_if_no_path(mpp->alias, 1);
0fe00a
+		if (!is_queueing)
0fe00a
+			dm_queue_if_no_path(mpp->alias, 1);
0fe00a
 		break;
0fe00a
 	default:
0fe00a
-		dm_queue_if_no_path(mpp->alias, 1);
0fe00a
-		if (mpp->nr_active == 0) {
0fe00a
+		if (mpp->nr_active > 0) {
0fe00a
+			mpp->retry_tick = 0;
0fe00a
+			if (!is_queueing)
0fe00a
+				dm_queue_if_no_path(mpp->alias, 1);
0fe00a
+		} else if (is_queueing && mpp->retry_tick == 0) {
0fe00a
 			/* Enter retry mode */
0fe00a
-			mpp->retry_tick = mpp->no_path_retry * conf->checkint;
0fe00a
+			mpp->stat_queueing_timeouts++;
0fe00a
+			mpp->retry_tick = mpp->no_path_retry *
0fe00a
+					  conf->checkint + 1;
0fe00a
 			condlog(1, "%s: Entering recovery mode: max_retries=%d",
0fe00a
 				mpp->alias, mpp->no_path_retry);
0fe00a
 		}
0fe00a
@@ -360,6 +369,7 @@ __setup_multipath (struct vectors * vecs
0fe00a
 	if (reset) {
0fe00a
 		select_rr_weight(mpp);
0fe00a
 		select_pgfailback(mpp);
0fe00a
+		select_no_path_retry(mpp);
0fe00a
 		set_no_path_retry(mpp);
0fe00a
 		select_pg_timeout(mpp);
0fe00a
 		select_flush_on_last_del(mpp);
0fe00a
Index: multipath-tools-130222/multipathd/main.c
0fe00a
===================================================================
0fe00a
--- multipath-tools-130222.orig/multipathd/main.c
0fe00a
+++ multipath-tools-130222/multipathd/main.c
0fe00a
@@ -1464,6 +1464,8 @@ check_path (struct vectors * vecs, struc
0fe00a
 	if (!pp->mpp)
0fe00a
 		return 0;
0fe00a
 
0fe00a
+	set_no_path_retry(pp->mpp);
0fe00a
+
0fe00a
 	if ((newstate == PATH_UP || newstate == PATH_GHOST) &&
0fe00a
 	    pp->io_err_disable_reinstate && need_io_err_check(pp)) {
0fe00a
 		pp->state = PATH_SHAKY;