From patchwork Wed Apr 27 19:52:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 737661 Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3RLF2nV031292 for ; Wed, 27 Apr 2011 21:15:35 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3RJqMWw001918; Wed, 27 Apr 2011 15:52:23 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3RJqL9r030127 for ; Wed, 27 Apr 2011 15:52:21 -0400 Received: from ether.msp.redhat.com (ether.msp.redhat.com [10.15.80.119]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3RJqFLA022373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 27 Apr 2011 15:52:16 -0400 Received: from ether.msp.redhat.com (localhost.localdomain [127.0.0.1]) by ether.msp.redhat.com (8.14.1/8.14.1) with ESMTP id p3RJqEta032627 for ; Wed, 27 Apr 2011 14:52:15 -0500 Received: (from bmarzins@localhost) by ether.msp.redhat.com (8.14.1/8.14.1/Submit) id p3RJqEkg032626 for dm-devel@redhat.com; Wed, 27 Apr 2011 14:52:14 -0500 Date: Wed, 27 Apr 2011 14:52:14 -0500 From: Benjamin Marzinski To: device-mapper development Message-ID: <20110427195214.GP23657@ether.msp.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH] multipath: clear checker message 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: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Apr 2011 21:15:35 +0000 (UTC) Clear the checker message at the start of get_state, so that stale checker messages aren't accidentally printed. Signed-off-by: Benjamin Marzinski --- libmultipath/checkers.c | 5 +++++ libmultipath/checkers.h | 1 + libmultipath/discovery.c | 1 + 3 files changed, 7 insertions(+) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel 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 */