From patchwork Wed Nov 21 10:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 10692335 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 900325C90 for ; Wed, 21 Nov 2018 10:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CC662B89F for ; Wed, 21 Nov 2018 10:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 676FE2B8A8; Wed, 21 Nov 2018 10:20:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B4AE12B8E5 for ; Wed, 21 Nov 2018 10:20:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9637581138; Wed, 21 Nov 2018 10:20:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6009F5C239; Wed, 21 Nov 2018 10:20:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1AFCD1832E8F; Wed, 21 Nov 2018 10:20:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wALAK14T015011 for ; Wed, 21 Nov 2018 05:20:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id A480D19021; Wed, 21 Nov 2018 10:20:01 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 00A3018E33; Wed, 21 Nov 2018 10:19:56 +0000 (UTC) Received: from smtp2.provo.novell.com (smtp2.provo.novell.com [137.65.250.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B935889AD1; Wed, 21 Nov 2018 10:19:55 +0000 (UTC) Received: from apollon.suse.de.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (TLS encrypted); Wed, 21 Nov 2018 03:19:45 -0700 From: Martin Wilck To: Christophe Varoqui Date: Wed, 21 Nov 2018 11:18:39 +0100 Message-Id: <20181121101839.30784-20-mwilck@suse.com> In-Reply-To: <20181121101839.30784-1-mwilck@suse.com> References: <20181121101839.30784-1-mwilck@suse.com> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Nov 2018 10:19:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Nov 2018 10:19:56 +0000 (UTC) for IP:'137.65.250.81' DOMAIN:'smtp2.provo.novell.com' HELO:'smtp2.provo.novell.com' FROM:'mwilck@suse.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.81 smtp2.provo.novell.com 137.65.250.81 smtp2.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Martin Wilck Subject: [dm-devel] [PATCH 19/19] libmultipath: improve logging from orphan_paths X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 21 Nov 2018 10:20:19 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP It's a big difference if a map is flushed from DM (changing kernel state) or just removed from internal multipathd tables. Convey this information in log messages. Signed-off-by: Martin Wilck --- libmultipath/structs_vec.c | 6 +++--- libmultipath/structs_vec.h | 3 ++- multipathd/main.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index a0b69ce5..4667e34f 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -102,14 +102,14 @@ void orphan_path(struct path *pp, const char *reason) pp->fd = -1; } -void orphan_paths(vector pathvec, struct multipath *mpp) +void orphan_paths(vector pathvec, struct multipath *mpp, const char *reason) { int i; struct path * pp; vector_foreach_slot (pathvec, pp, i) { if (pp->mpp == mpp) { - orphan_path(pp, "map flushed"); + orphan_path(pp, reason); } } } @@ -122,7 +122,7 @@ remove_map(struct multipath * mpp, struct vectors * vecs, int purge_vec) /* * clear references to this map */ - orphan_paths(vecs->pathvec, mpp); + orphan_paths(vecs->pathvec, mpp, "map removed internally"); if (purge_vec && (i = find_slot(vecs->mpvec, (void *)mpp)) != -1) diff --git a/libmultipath/structs_vec.h b/libmultipath/structs_vec.h index f7777aaf..f8b9f63e 100644 --- a/libmultipath/structs_vec.h +++ b/libmultipath/structs_vec.h @@ -14,7 +14,8 @@ struct vectors { void enter_recovery_mode(struct multipath *mpp); int adopt_paths (vector pathvec, struct multipath * mpp); -void orphan_paths (vector pathvec, struct multipath * mpp); +void orphan_paths(vector pathvec, struct multipath *mpp, + const char *reason); void orphan_path (struct path * pp, const char *reason); int verify_paths(struct multipath * mpp, struct vectors * vecs); diff --git a/multipathd/main.c b/multipathd/main.c index 0c248046..77126f9e 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -655,7 +655,7 @@ flush_map(struct multipath * mpp, struct vectors * vecs, int nopaths) condlog(2, "%s: map flushed", mpp->alias); } - orphan_paths(vecs->pathvec, mpp); + orphan_paths(vecs->pathvec, mpp, "map flushed"); remove_map_and_stop_waiter(mpp, vecs); return 0;