[dm-devel] [PATCH v3 3/7] libmultipath: cleanup orphan device states

Benjamin Marzinski bmarzins at redhat.com
Wed Feb 15 02:16:53 UTC 2017


After a path device is orphaned, multipathd stops checking its state.
However, multipathd show state still shows its old state. It should
display "undef unknown" instead.

Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 libmultipath/print.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmultipath/print.c b/libmultipath/print.c
index 5b03383..00a3626 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -392,7 +392,7 @@ snprint_dev_t (char * buff, size_t len, struct path * pp)
 static int
 snprint_offline (char * buff, size_t len, struct path * pp)
 {
-	if (!pp)
+	if (!pp || !pp->mpp)
 		return snprintf(buff, len, "unknown");
 	else if (pp->offline)
 		return snprintf(buff, len, "offline");
@@ -403,7 +403,7 @@ snprint_offline (char * buff, size_t len, struct path * pp)
 static int
 snprint_chk_state (char * buff, size_t len, struct path * pp)
 {
-	if (!pp)
+	if (!pp || !pp->mpp)
 		return snprintf(buff, len, "undef");
 
 	switch (pp->state) {
-- 
1.8.3.1




More information about the dm-devel mailing list