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