Blame SOURCES/0104-libmultipath-use-symbolic-value-for-invalid-pcentry.patch

aab12e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
aab12e
From: Benjamin Marzinski <bmarzins@redhat.com>
aab12e
Date: Thu, 14 Apr 2022 16:11:10 -0500
aab12e
Subject: [PATCH] libmultipath: use symbolic value for invalid pcentry
aab12e
aab12e
Suggested-by: Martin Wilck <mwilck@suse.com>
aab12e
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
aab12e
Reviewed-by: Martin Wilck <mwilck@suse.com>
aab12e
---
aab12e
 libmultipath/config.c | 4 ++--
aab12e
 libmultipath/config.h | 1 +
aab12e
 2 files changed, 3 insertions(+), 2 deletions(-)
aab12e
aab12e
diff --git a/libmultipath/config.c b/libmultipath/config.c
aab12e
index 88975323..bcd8b541 100644
aab12e
--- a/libmultipath/config.c
aab12e
+++ b/libmultipath/config.c
aab12e
@@ -319,7 +319,7 @@ alloc_pce (void)
aab12e
 {
aab12e
 	struct pcentry *pce = (struct pcentry *)
aab12e
 				calloc(1, sizeof(struct pcentry));
aab12e
-	pce->type = -1;
aab12e
+	pce->type = PCE_INVALID;
aab12e
 	return pce;
aab12e
 }
aab12e
 
aab12e
@@ -578,7 +578,7 @@ validate_pctable(struct hwentry *ovr, int idx, const char *table_desc)
aab12e
 		return;
aab12e
 
aab12e
 	vector_foreach_slot_after(ovr->pctable, pce, idx) {
aab12e
-		if (pce->type < 0) {
aab12e
+		if (pce->type == PCE_INVALID) {
aab12e
 			condlog(0, "protocol section in %s missing type",
aab12e
 				table_desc);
aab12e
 			vector_del_slot(ovr->pctable, idx--);
aab12e
diff --git a/libmultipath/config.h b/libmultipath/config.h
aab12e
index 143116b3..477f8bfa 100644
aab12e
--- a/libmultipath/config.h
aab12e
+++ b/libmultipath/config.h
aab12e
@@ -41,6 +41,7 @@ enum force_reload_types {
aab12e
 	FORCE_RELOAD_WEAK,
aab12e
 };
aab12e
 
aab12e
+#define PCE_INVALID -1
aab12e
 struct pcentry {
aab12e
 	int type;
aab12e
 	int fast_io_fail;