device-mapper-multipath/0001-libmultipath-fix-show-paths-format-failure.patch
Benjamin Marzinski c5432960d9 device-mapper-multipath-0.9.3-1
Update to the head of the upstream staging branch
  * Previous patches 0001-0042 are included in the source tarball
  * Patches 0001-0032 are from the upstream staging branch
Rename redhat patches
  * Previous patches 0043-0053 are now patches 0033-0043
Change back to using readline instead of libedit
  * The code the uses readline has been isolated from the code that
    is licensed gpl v2 only.
Add libmpathutil libraries to spec file
Add multipathc program to spec file
Add multipath.conf systemd tempfile configuration to spec file
Misc spec file cleanups
2022-11-16 14:11:59 -06:00

36 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Koetsier <github.com@unicast.nl>
Date: Thu, 27 Oct 2022 19:29:28 +0200
Subject: [PATCH] libmultipath: fix 'show paths format' failure
Prevent 'multipathd show paths format "%c"' from failing on orphan paths.
For orphan paths the checker class isn't set, which caused
snprint_path_checker() to fail which in turn caused 'show paths format' to fail
when the format string contained "%c".
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/print.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libmultipath/print.c b/libmultipath/print.c
index d7d522c8..3193dbe0 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -734,8 +734,12 @@ snprint_host_adapter (struct strbuf *buff, const struct path * pp)
static int
snprint_path_checker (struct strbuf *buff, const struct path * pp)
{
- const struct checker * c = &pp->checker;
- return snprint_str(buff, checker_name(c));
+ const char * n = checker_name(&pp->checker);
+
+ if (n)
+ return snprint_str(buff, n);
+ else
+ return snprint_str(buff, "(null)");
}
static int