Blame SOURCES/0036-libmultipath-fix-disassemble-status-for-historical-s.patch

e65fa3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
e65fa3
From: Benjamin Marzinski <bmarzins@redhat.com>
e65fa3
Date: Wed, 12 Jan 2022 12:26:12 -0600
e65fa3
Subject: [PATCH] libmultipath: fix disassemble status for
e65fa3
 historical-service-time PS
e65fa3
e65fa3
The historical-service-time path selector prints out 2 path group status
e65fa3
arguments. This is the only path selector that uses the group status
e65fa3
arguments. All the others only have path status arguments.
e65fa3
disassemble_status() was expecting the number of group status arguments
e65fa3
to always be zero, causing it to fail at disassembling the status of
e65fa3
devices that use historical-service-time path selector. Now multipath
e65fa3
actually checks the number of group arguments, and skips them.
e65fa3
e65fa3
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
e65fa3
---
e65fa3
 libmultipath/dmparser.c | 14 ++++++++++++--
e65fa3
 1 file changed, 12 insertions(+), 2 deletions(-)
e65fa3
e65fa3
diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
e65fa3
index 4ba7f339..bc311421 100644
e65fa3
--- a/libmultipath/dmparser.c
e65fa3
+++ b/libmultipath/dmparser.c
e65fa3
@@ -437,9 +437,19 @@ int disassemble_status(const char *params, struct multipath *mpp)
e65fa3
 		FREE(word);
e65fa3
 
e65fa3
 		/*
e65fa3
-		 * PG Status (discarded, would be '0' anyway)
e65fa3
+		 * Path Selector Group Arguments
e65fa3
 		 */
e65fa3
-		p += get_word(p, NULL);
e65fa3
+		p += get_word(p, &word);
e65fa3
+
e65fa3
+		if (!word)
e65fa3
+			return 1;
e65fa3
+
e65fa3
+		num_pg_args = atoi(word);
e65fa3
+		free(word);
e65fa3
+
e65fa3
+		/* Ignore ps group arguments */
e65fa3
+		for (j = 0; j < num_pg_args; j++)
e65fa3
+			p += get_word(p, NULL);
e65fa3
 
e65fa3
 		p += get_word(p, &word);
e65fa3