From patchwork Fri Dec 13 12:14:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 3339991 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 818E3C0D4B for ; Fri, 13 Dec 2013 12:18:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7229E20426 for ; Fri, 13 Dec 2013 12:18:25 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mail.kernel.org (Postfix) with ESMTP id 0EE89207C5 for ; Fri, 13 Dec 2013 12:18:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBDCF73P009193; Fri, 13 Dec 2013 07:15:09 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBDCESgW026935 for ; Fri, 13 Dec 2013 07:14:28 -0500 Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBDCESfv018721 for ; Fri, 13 Dec 2013 07:14:28 -0500 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBDCERUl017504 for ; Fri, 13 Dec 2013 07:14:27 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 42CE6ABCA for ; Fri, 13 Dec 2013 12:14:27 +0000 (UTC) From: Hannes Reinecke To: dm-devel@redhat.com Date: Fri, 13 Dec 2013 13:14:07 +0100 Message-Id: <1386936854-8399-5-git-send-email-hare@suse.de> In-Reply-To: <1386936854-8399-1-git-send-email-hare@suse.de> References: <1386936854-8399-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -6.9 (BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.21 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 04/11] multipath: do not print 'path is up' for removed paths X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When a path is removed the previous checker message is still kept in the checker context, and will be printed upon each check. This causes multipath to print out 'path is up' even though it already has been removed from sysfs. Signed-off-by: Hannes Reinecke --- multipathd/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index 91d7bfc..2633da9 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -1124,6 +1124,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); @@ -1150,7 +1152,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 @@ -1232,7 +1236,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