File multipath-tools-reset-checker-message of Package multipath-tools

commit 353cfedad82eece545cf282892a6142ad34164e9
Author: Hannes Reinecke <hare@suse.de>
Date:   Fri Mar 20 10:28:44 2009 +0100

    Reset checker message when rport is blocked
    
    When a FC rport is blocked the checkers will not be called.
    But we should reset the checker message here so as not to
    display a stale checker message.
    
    Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c
index e1789e5..6cdc83f 100644
--- a/libmultipath/checkers.c
+++ b/libmultipath/checkers.c
@@ -201,6 +201,11 @@ char * checker_message (struct checker * c)
 	return c->message;
 }
 
+void checker_reset_message (struct checker * c)
+{
+	c->message[0] = '\0';
+}
+
 void checker_get (struct checker * dst, char * name)
 {
 	struct checker * src = checker_lookup(name);
diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h
index da09d6c..371f887 100644
--- a/libmultipath/checkers.h
+++ b/libmultipath/checkers.h
@@ -127,6 +127,7 @@ int checker_check (struct checker *);
 int checker_selected (struct checker *);
 char * checker_name (struct checker *);
 char * checker_message (struct checker *);
+void checker_reset_message (struct checker *);
 void checker_get (struct checker *, char *);
 
 #endif /* _CHECKERS_H */
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index ac2e9a7..5b3c362 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -813,6 +813,7 @@ get_state (struct path * pp)
 			/* Further checking pointless */
 			condlog(3, "%s: state (sysfs) = %s", pp->dev,
 				checker_state_name(state));
+			checker_reset_message(c);
 			return state;
 		}
 	}
openSUSE Build Service is sponsored by