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

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