Blame SOURCES/0260-RHBZ-1634183-prio-fixes.patch

0fe00a
---
0fe00a
 libmultipath/discovery.c        |   15 +++++++++++++--
0fe00a
 libmultipath/pgpolicies.c       |    2 +-
0fe00a
 libmultipath/prioritizers/ana.c |    2 +-
0fe00a
 3 files changed, 15 insertions(+), 4 deletions(-)
0fe00a
0fe00a
Index: multipath-tools-130222/libmultipath/discovery.c
0fe00a
===================================================================
0fe00a
--- multipath-tools-130222.orig/libmultipath/discovery.c
0fe00a
+++ multipath-tools-130222/libmultipath/discovery.c
0fe00a
@@ -1234,6 +1234,7 @@ get_state (struct path * pp, int daemon,
0fe00a
 static int
0fe00a
 get_prio (struct path * pp)
0fe00a
 {
0fe00a
+	int old_prio;
0fe00a
 	if (!pp)
0fe00a
 		return 0;
0fe00a
 
0fe00a
@@ -1247,10 +1248,20 @@ get_prio (struct path * pp)
0fe00a
 			return 1;
0fe00a
 		}
0fe00a
 	}
0fe00a
+	old_prio = pp->priority;
0fe00a
 	pp->priority = prio_getprio(p, pp);
0fe00a
 	if (pp->priority < 0) {
0fe00a
-		condlog(3, "%s: %s prio error", pp->dev, prio_name(p));
0fe00a
-		pp->priority = PRIO_UNDEF;
0fe00a
+		/* this changes pp->offline, but why not */
0fe00a
+		int state = path_offline(pp);
0fe00a
+
0fe00a
+		if (state == PATH_DOWN || state == PATH_PENDING) {
0fe00a
+			pp->priority = old_prio;
0fe00a
+			condlog(3, "%s: %s prio error in state %d, keeping prio = %d", pp->dev, prio_name(p), state, pp->priority);
0fe00a
+		} else {
0fe00a
+			condlog(3, "%s: %s prio error in state %d",
0fe00a
+				pp->dev, prio_name(p), state);
0fe00a
+			pp->priority = PRIO_UNDEF;
0fe00a
+		}
0fe00a
 		return 1;
0fe00a
 	}
0fe00a
 	condlog(3, "%s: %s prio = %u",
0fe00a
Index: multipath-tools-130222/libmultipath/pgpolicies.c
0fe00a
===================================================================
0fe00a
--- multipath-tools-130222.orig/libmultipath/pgpolicies.c
0fe00a
+++ multipath-tools-130222/libmultipath/pgpolicies.c
0fe00a
@@ -308,7 +308,7 @@ extern int
0fe00a
 group_by_prio (struct multipath * mp)
0fe00a
 {
0fe00a
 	int i;
0fe00a
-	unsigned int prio;
0fe00a
+	int prio;
0fe00a
 	struct path * pp;
0fe00a
 	struct pathgroup * pgp;
0fe00a
 
0fe00a
Index: multipath-tools-130222/libmultipath/prioritizers/ana.c
0fe00a
===================================================================
0fe00a
--- multipath-tools-130222.orig/libmultipath/prioritizers/ana.c
0fe00a
+++ multipath-tools-130222/libmultipath/prioritizers/ana.c
0fe00a
@@ -165,7 +165,7 @@ int get_ana_info(struct path * pp, unsig
0fe00a
 				   ana_log, ana_log_len);
0fe00a
 	pthread_cleanup_pop(1);
0fe00a
 	if (rc >= 0)
0fe00a
-		condlog(3, "%s: ana state = %02x [%s]", pp->dev, rc,
0fe00a
+		condlog(4, "%s: ana state = %02x [%s]", pp->dev, rc,
0fe00a
 			aas_print_string(rc));
0fe00a
 	return rc;
0fe00a
 }