Skip to contentSkip to conversation

libmultipath: get_prio(): really don't reset prio for inaccessible paths

PATCH In review Martin Wilck 2 participants 2 messages May 16, 2019 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmultipath: get_prio(): really don't reset prio for inaccessible paths

As pointed out by Ben Marzinski, my previous patch ebbb56f2 doesn't do what it pretends to do.

Fixes ebbb56f2 "libmultipath: get_prio(): don't reset prio for inaccessible

paths"

---
 libmultipath/discovery.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
libmultipath/discovery.c +3 -2
index b3dc60b1..856c52c6 100644
@@ -1648,10 +1648,11 @@ get_prio (struct path * pp)
 		/* this changes pp->offline, but why not */
 		int state = path_offline(pp);
 
-		if (state == PATH_DOWN || state == PATH_PENDING)
+		if (state == PATH_DOWN || state == PATH_PENDING) {
+			pp->priority = old_prio;
 			condlog(3, "%s: %s prio error in state %d, keeping prio = %d",
 				pp->dev, prio_name(p), state, pp->priority);
-		else {
+		} else {
 			condlog(3, "%s: %s prio error in state %d",
 				pp->dev, prio_name(p), state);
 			pp->priority = PRIO_UNDEF;
Signature · 1 line
2.21.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Martin Wilck

As pointed out by Ben Marzinski, my previous patch ebbb56f2 doesn't do what it pretends to do.

Fixes ebbb56f2 "libmultipath: get_prio(): don't reset prio for inaccessible

paths"

Quoted 24 lines
---
 libmultipath/discovery.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
libmultipath/discovery.c +3 -2
index b3dc60b1..856c52c6 100644
@@ -1648,10 +1648,11 @@ get_prio (struct path * pp)
 		/* this changes pp->offline, but why not */
 		int state = path_offline(pp);
 
-		if (state == PATH_DOWN || state == PATH_PENDING)
+		if (state == PATH_DOWN || state == PATH_PENDING) {
+			pp->priority = old_prio;
 			condlog(3, "%s: %s prio error in state %d, keeping prio = %d",
 				pp->dev, prio_name(p), state, pp->priority);
-		else {
+		} else {
 			condlog(3, "%s: %s prio error in state %d",
 				pp->dev, prio_name(p), state);
 			pp->priority = PRIO_UNDEF;
Signature · 1 line
2.21.0