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