Skip to contentSkip to conversation

multipathd: add failures path format wildcard

PATCH New Benjamin Marzinski 1 participant 2 messages Apr 24, 2018 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 1/2 multipathd: add failures path format wildcard

multipath already tracks this, so it should be able to print it out.

---
 libmultipath/print.c | 7 +++++++
 1 file changed, 7 insertions(+)
libmultipath/print.c +7 -0
index d532994..b1844c9 100644
@@ -632,6 +632,12 @@ snprint_path_foreign (char * buff, size_t len, const struct path * pp)
 	return snprintf(buff, len, "%s", "--");
 }
 
+static int
+snprint_path_failures(char * buff, size_t len, const struct path * pp)
+{
+	return snprint_int(buff, len, pp->failcount);
+}
+
 struct multipath_data mpd[] = {
 	{'n', "name",          0, snprint_name},
 	{'w', "uuid",          0, snprint_multipath_uuid},
@@ -680,6 +686,7 @@ struct path_data pd[] = {
 	{'r', "target WWPN",   0, snprint_tgt_wwpn},
 	{'a', "host adapter",  0, snprint_host_adapter},
 	{'G', "foreign",       0, snprint_path_foreign},
+	{'0', "failures",      0, snprint_path_failures},
 	{0, NULL, 0 , NULL}
 };
 
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH 2/2 multipathd: fix reservation_key check

mpath_pr_event_handle should exit if the reservation key is zero, not non-zero.

---
 multipathd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multipathd/main.c +1 -1
index 841d3e9..84af946 100644
@@ -3136,7 +3136,7 @@ int mpath_pr_event_handle(struct path *pp)
 
 	mpp = pp->mpp;
 
-	if (get_be64(mpp->reservation_key))
+	if (!get_be64(mpp->reservation_key))
 		return -1;
 
 	pthread_attr_init(&attr);
Signature · 1 line
2.7.4