Blame SOURCES/0026-filter-mpath-handle-other-wwid-types-in-blacklist.patch

33aaf1
From 1f3ce86bf26bc7173dfde516ab1ace71e0c8074b Mon Sep 17 00:00:00 2001
33aaf1
From: David Teigland <teigland@redhat.com>
33aaf1
Date: Mon, 6 Jun 2022 11:39:02 -0500
33aaf1
Subject: [PATCH 2/2] filter-mpath: handle other wwid types in blacklist
33aaf1
33aaf1
Fixes commit 494372b4eed0c8f6040e3357939eb7511ac25745
33aaf1
  "filter-mpath: use multipath blacklist"
33aaf1
to handle wwids with initial type digits 1 and 2 used
33aaf1
for t10 and eui ids.  Originally recognized type 3 naa.
33aaf1
33aaf1
(cherry picked from commit 25abb5730f4d8f79df69f0817881ffb9eed195a9)
33aaf1
---
33aaf1
 lib/device/dev-mpath.c | 11 ++++++-----
33aaf1
 1 file changed, 6 insertions(+), 5 deletions(-)
33aaf1
33aaf1
diff --git a/lib/device/dev-mpath.c b/lib/device/dev-mpath.c
33aaf1
index 580ab31a5..3d0626fe3 100644
33aaf1
--- a/lib/device/dev-mpath.c
33aaf1
+++ b/lib/device/dev-mpath.c
33aaf1
@@ -54,7 +54,7 @@ static void _read_blacklist_file(const char *path)
33aaf1
 	int section_black = 0;
33aaf1
 	int section_exceptions = 0;
33aaf1
 	int found_quote;
33aaf1
-	int found_three;
33aaf1
+	int found_type;
33aaf1
 	int i, j;
33aaf1
 
33aaf1
 	if (!(fp = fopen(path, "r")))
33aaf1
@@ -114,7 +114,7 @@ static void _read_blacklist_file(const char *path)
33aaf1
 
33aaf1
 		memset(wwid, 0, sizeof(wwid));
33aaf1
 		found_quote = 0;
33aaf1
-		found_three = 0;
33aaf1
+		found_type = 0;
33aaf1
 		j = 0;
33aaf1
 
33aaf1
 		for (; i < MAX_WWID_LINE; i++) {
33aaf1
@@ -132,9 +132,10 @@ static void _read_blacklist_file(const char *path)
33aaf1
 			/* second quote is end of wwid */
33aaf1
 			if ((line[i] == '"') && found_quote)
33aaf1
 				break;
33aaf1
-			/* ignore first "3" in wwid */
33aaf1
-			if ((line[i] == '3') && !found_three) {
33aaf1
-				found_three = 1;
33aaf1
+			/* exclude initial 3/2/1 for naa/eui/t10 */
33aaf1
+			if (!j && !found_type &&
33aaf1
+			    ((line[i] == '3') || (line[i] == '2') || (line[i] == '1'))) {
33aaf1
+				found_type = 1;
33aaf1
 				continue;
33aaf1
 			}
33aaf1
 
33aaf1
-- 
33aaf1
2.34.3
33aaf1