All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] multipath: clear checker message
@ 2011-04-27 19:52 Benjamin Marzinski
  2011-04-27 21:01 ` Christophe Varoqui
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Marzinski @ 2011-04-27 19:52 UTC (permalink / raw)
  To: device-mapper development

Clear the checker message at the start of get_state, so that stale checker
messages aren't accidentally printed.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/checkers.c  |    5 +++++
 libmultipath/checkers.h  |    1 +
 libmultipath/discovery.c |    1 +
 3 files changed, 7 insertions(+)

Index: multipath-tools-110412/libmultipath/discovery.c
===================================================================
--- multipath-tools-110412.orig/libmultipath/discovery.c
+++ multipath-tools-110412/libmultipath/discovery.c
@@ -848,6 +848,7 @@ get_state (struct path * pp, int daemon)
 			return PATH_UNCHECKED;
 		}
 	}
+	checker_clear_message(c);
 	state = path_offline(pp);
 	if (state != PATH_UP) {
 		condlog(3, "%s: path inaccessible", pp->dev);
Index: multipath-tools-110412/libmultipath/checkers.c
===================================================================
--- multipath-tools-110412.orig/libmultipath/checkers.c
+++ multipath-tools-110412/libmultipath/checkers.c
@@ -183,6 +183,11 @@ char * checker_message (struct checker *
 	return c->message;
 }
 
+void checker_clear_message (struct checker *c)
+{
+	c->message[0] = '\0';
+}
+
 void checker_get (struct checker * dst, char * name)
 {
 	struct checker * src = checker_lookup(name);
Index: multipath-tools-110412/libmultipath/checkers.h
===================================================================
--- multipath-tools-110412.orig/libmultipath/checkers.h
+++ multipath-tools-110412/libmultipath/checkers.h
@@ -114,6 +114,7 @@ int checker_check (struct checker *);
 int checker_selected (struct checker *);
 char * checker_name (struct checker *);
 char * checker_message (struct checker *);
+void checker_clear_message (struct checker *c);
 void checker_get (struct checker *, char *);
 
 #endif /* _CHECKERS_H */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-27 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 19:52 [PATCH] multipath: clear checker message Benjamin Marzinski
2011-04-27 21:01 ` Christophe Varoqui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.