multipath: do not print 'path is up' for removed paths
[multipath-tools/.git] / multipathd / main.c
index 3219511..309b1aa 100644 (file)
@@ -1127,6 +1127,8 @@ check_path (struct vectors * vecs, struct path * pp)
        newstate = path_offline(pp);
        if (newstate == PATH_UP)
                newstate = get_state(pp, 1);
+       else
+               checker_clear_message(&pp->checker);
 
        if (newstate == PATH_WILD || newstate == PATH_UNCHECKED) {
                condlog(2, "%s: unusable path", pp->dev);
@@ -1153,7 +1155,9 @@ check_path (struct vectors * vecs, struct path * pp)
        if (newstate != pp->state) {
                int oldstate = pp->state;
                pp->state = newstate;
-               LOG_MSG(1, checker_message(&pp->checker));
+
+               if (strlen(checker_message(&pp->checker)))
+                       LOG_MSG(1, checker_message(&pp->checker));
 
                /*
                 * upon state change, reset the checkint
@@ -1235,7 +1239,8 @@ check_path (struct vectors * vecs, struct path * pp)
                        pp->tick = pp->checkint;
                }
        }
-       else if (newstate == PATH_DOWN) {
+       else if (newstate == PATH_DOWN &&
+                strlen(checker_message(&pp->checker))) {
                if (conf->log_checker_err == LOG_CHKR_ERR_ONCE)
                        LOG_MSG(3, checker_message(&pp->checker));
                else