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

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