From patchwork Thu Jun 22 14:59:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 9804613 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.web.codeaurora.org (Postfix) with ESMTP id 68DCA60329 for ; Thu, 22 Jun 2017 15:07:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 558B728397 for ; Thu, 22 Jun 2017 15:07:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A739286BB; Thu, 22 Jun 2017 15:07:19 +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 D0A5428397 for ; Thu, 22 Jun 2017 15:07:18 +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 B557FC049DFD; Thu, 22 Jun 2017 15:07:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B557FC049DFD 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 B557FC049DFD 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 970355D970; Thu, 22 Jun 2017 15:07: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 628BF184383E; Thu, 22 Jun 2017 15:07:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5MExttC012181 for ; Thu, 22 Jun 2017 10:59:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id A842960470; Thu, 22 Jun 2017 14:59:55 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C46525C7A5; Thu, 22 Jun 2017 14:59:53 +0000 (UTC) Received: from prv3-mh.provo.novell.com (prv3-mh.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 D368DC04D2B7; Thu, 22 Jun 2017 14:59:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D368DC04D2B7 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=mwilck@suse.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D368DC04D2B7 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); Thu, 22 Jun 2017 08:59:45 -0600 From: Martin Wilck To: Christophe Varoqui , Hannes Reinecke Date: Thu, 22 Jun 2017 16:59:06 +0200 Message-Id: <20170622145913.23714-5-mwilck@suse.com> In-Reply-To: <20170622145913.23714-1-mwilck@suse.com> References: <20170622145913.23714-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.31]); Thu, 22 Jun 2017 14:59:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 22 Jun 2017 14:59:53 +0000 (UTC) for IP:'137.65.250.26' DOMAIN:'prv3-mh.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 prv3-mh.provo.novell.com 137.65.250.26 prv3-mh.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Xose Vazquez Perez Subject: [dm-devel] [PATCH v4 04/11] 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]); Thu, 22 Jun 2017 15:07:18 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP The logic applied here should match the logic in select_features(). This is achieved by calling reconcile_features_with_options(). Signed-off-by: Martin Wilck Acked-by: Benjamin Marzinski --- libmultipath/config.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index 60e345b3..b21a3aa1 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -25,6 +25,7 @@ #include "prio.h" #include "devmapper.h" #include "mpath_cmd.h" +#include "propsel.h" static int hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2) @@ -318,6 +319,7 @@ set_param_str(char * str) static int merge_hwe (struct hwentry * dst, struct hwentry * src) { + char id[SCSI_VENDOR_SIZE+SCSI_PRODUCT_SIZE]; merge_str(vendor); merge_str(product); merge_str(revision); @@ -353,15 +355,10 @@ merge_hwe (struct hwentry * dst, struct hwentry * src) merge_num(san_path_err_forget_rate); merge_num(san_path_err_recovery_time); - /* - * Make sure features is consistent with - * no_path_retry - */ - if (dst->no_path_retry == NO_PATH_RETRY_FAIL) - 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"); - + snprintf(id, sizeof(id), "%s/%s", dst->vendor, dst->product); + reconcile_features_with_options(id, &dst->features, + &dst->no_path_retry, + &dst->retain_hwhandler); return 0; }