From patchwork Tue Jun 13 22:55:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 9784895 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3D76060212 for ; Tue, 13 Jun 2017 22:56:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 306E028581 for ; Tue, 13 Jun 2017 22:56:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2553F2858D; Tue, 13 Jun 2017 22:56:52 +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=-6.9 required=2.0 tests=BAYES_00,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 9CEC728581 for ; Tue, 13 Jun 2017 22:56:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1785C04B941; Tue, 13 Jun 2017 22:56:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C1785C04B941 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C1785C04B941 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 A60A97B618; Tue, 13 Jun 2017 22:56:50 +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 6BE6F1841C45; Tue, 13 Jun 2017 22:56:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5DMui1G027788 for ; Tue, 13 Jun 2017 18:56:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 294A89116B; Tue, 13 Jun 2017 22:56:44 +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 1FE08781EB; Tue, 13 Jun 2017 22:56:44 +0000 (UTC) Received: from prv3-mh.provo.novell.com (victor.provo.novell.com [137.65.250.26]) (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 1180185A07; Tue, 13 Jun 2017 22:56:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1180185A07 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mwilck@suse.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1180185A07 Received: from apollon.suse.de.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Tue, 13 Jun 2017 16:56:26 -0600 From: Martin Wilck To: Christophe Varoqui , Hannes Reinecke Date: Wed, 14 Jun 2017 00:55:51 +0200 Message-Id: <20170613225554.11181-5-mwilck@suse.com> In-Reply-To: <20170613225554.11181-1-mwilck@suse.com> References: <20170613225554.11181-1-mwilck@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 13 Jun 2017 22:56:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 13 Jun 2017 22:56:43 +0000 (UTC) for IP:'137.65.250.26' DOMAIN:'victor.provo.novell.com' HELO:'prv3-mh.provo.novell.com' FROM:'mwilck@suse.com' RCPT:'' X-RedHat-Spam-Score: -1.501 (BAYES_50, RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.26 victor.provo.novell.com 137.65.250.26 victor.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Xose Vazquez Perez Subject: [dm-devel] [PATCH 4/7] libmultipath: merge_hwe: fix queue_if_no_path logic 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: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 13 Jun 2017 22:56:51 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP The logic applied here should match the logic in select_features(). If no_path_retry is anything but "undef", queue_if_no_path can be removed from the feature string, assemble_map() will infer it correctly. The case where no_path_retry is undefined and "queue_if_no_path" is set is treated as if "no_path_retry queue" had been set. Signed-off-by: Martin Wilck --- libmultipath/config.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index 61bbba91..b928fbe7 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -355,12 +355,24 @@ merge_hwe (struct hwentry * dst, struct hwentry * src) /* * Make sure features is consistent with - * no_path_retry + * no_path_retry. + * The logic should be consistent with select_features(). + * The actual queue_if_no_path feature is set in assemble_map(). */ - if (dst->no_path_retry == NO_PATH_RETRY_FAIL) + if (dst->no_path_retry == NO_PATH_RETRY_UNDEF && + strstr(dst->features, "queue_if_no_path")) { + condlog(3, "%s/%s: 'queue_if_no_path' is set, assuming no_path_retry='queue'", + dst->vendor, dst->product); + dst->no_path_retry = NO_PATH_RETRY_QUEUE; + } + else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF) { + condlog(3, "%s/%s: 'no_path_retry' is set, ignoring 'queue_if_no_path'", + dst->vendor, dst->product); remove_feature(&dst->features, "queue_if_no_path"); - else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF) - add_feature(&dst->features, "queue_if_no_path"); + } + + if (dst->retain_hwhandler != RETAIN_HWHANDLER_UNDEF) + remove_feature(&dst->features, "retain_attached_hw_handler"); return 0; }