From patchwork Mon Mar 16 12:36:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 6017571 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D92A39F399 for ; Mon, 16 Mar 2015 12:40:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02F4A200F4 for ; Mon, 16 Mar 2015 12:40:40 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 173D0204D1 for ; Mon, 16 Mar 2015 12:40:38 +0000 (UTC) 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 t2GCcGgV027937; Mon, 16 Mar 2015 08:38:17 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t2GCbHdD028820 for ; Mon, 16 Mar 2015 08:37:17 -0400 Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2GCbH4G020290; Mon, 16 Mar 2015 08:37:17 -0400 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 t2GCbFLE019188 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=FAIL); Mon, 16 Mar 2015 08:37:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9F188ADE1; Mon, 16 Mar 2015 12:37:09 +0000 (UTC) From: Hannes Reinecke To: Christophe Varoqui Date: Mon, 16 Mar 2015 13:36:28 +0100 Message-Id: <1426509425-15978-42-git-send-email-hare@suse.de> In-Reply-To: <1426509425-15978-1-git-send-email-hare@suse.de> References: <1426509425-15978-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -7.309 (BAYES_00, DCC_REPUT_00_12, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, URIBL_BLOCKED) 195.135.220.15 cantor2.suse.de 195.135.220.15 cantor2.suse.de X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.17 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 41/78] Add paths with a size of '0' as 'ghost' 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, T_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 SPC-3 does not require that a port in 'standby' has to support the 'READ CAPACITY' command. As such we should not reject those paths, but rather add them as 'ghost' paths. Signed-off-by: Hannes Reinecke --- libmultipath/discovery.c | 5 +++++ libmultipath/structs_vec.c | 2 +- multipathd/main.c | 26 +++++--------------------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 7d3ff49..6ba14ac 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -1215,6 +1215,11 @@ pathinfo (struct path *pp, vector hwtable, int mask) goto blank; if (pp->state == PATH_TIMEOUT) pp->state = PATH_DOWN; + if (pp->state == PATH_UP && !pp->size) { + condlog(3, "%s: device size is 0, " + "path unuseable", pp->dev); + pp->state = PATH_GHOST; + } } else { condlog(3, "%s: path inaccessible", pp->dev); pp->chkrstate = pp->state = path_state; diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c index 79f31b1..6be8c51 100644 --- a/libmultipath/structs_vec.c +++ b/libmultipath/structs_vec.c @@ -558,7 +558,7 @@ int update_multipath (struct vectors *vecs, char *mapname, int reset) if (pp->state != PATH_DOWN) { int oldstate = pp->state; - condlog(2, "%s: mark as failed", pp->dev_t); + condlog(2, "%s: mark as failed", pp->dev); mpp->stat_path_failures++; pp->state = PATH_DOWN; if (oldstate == PATH_UP || diff --git a/multipathd/main.c b/multipathd/main.c index ac1e1a2..6a3fd5e 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -479,15 +479,10 @@ ev_add_path (struct path * pp, struct vectors * vecs) mpp = pp->mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); rescan: if (mpp) { - if ((!pp->size) || (mpp->size != pp->size)) { - if (!pp->size) - condlog(0, "%s: failed to add new path %s, " - "device size is 0", - mpp->alias, pp->dev); - else - condlog(0, "%s: failed to add new path %s, " - "device size mismatch", - mpp->alias, pp->dev); + if (mpp->size != pp->size) { + condlog(0, "%s: failed to add new path %s, " + "device size mismatch", + mpp->alias, pp->dev); int i = find_slot(vecs->pathvec, (void *)pp); if (i != -1) vector_del_slot(vecs->pathvec, i); @@ -503,18 +498,7 @@ rescan: verify_paths(mpp, vecs, NULL); mpp->flush_on_last_del = FLUSH_UNDEF; mpp->action = ACT_RELOAD; - } - else { - if (!pp->size) { - condlog(0, "%s: failed to create new map," - " device size is 0 ", pp->dev); - int i = find_slot(vecs->pathvec, (void *)pp); - if (i != -1) - vector_del_slot(vecs->pathvec, i); - free_path(pp); - return 1; - } - + } else { if (conf->find_multipaths && !should_multipath(pp, vecs->pathvec)) { orphan_path(pp, "only one path");