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

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