From patchwork Fri Dec 18 23:06:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11983209 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C766C4361B for ; Fri, 18 Dec 2020 23:06:58 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B904923BA7 for ; Fri, 18 Dec 2020 23:06:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B904923BA7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608332816; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FlchAVZFcDjU8HWiBlTNbVi16WIiNFcnf89Fj56p0Ok=; b=YT6EUS3nG/LYAJshvGt6FDtneC/nWCVvFHFXvWwLn/6NMwmow5BgcbBQ9+60ed5f7spkwM vmN2T0kbJ/1rI7Xiu6LMIemIWTvtzGv9tN5Rp8/UvrEl36n3vLTu6p5uVmC1A6oLt6rJNP T+ngFRrNl+3SnuC2FWskzlxL4P0nM3Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-XzlAEV4bNzqBYMfaImHEYg-1; Fri, 18 Dec 2020 18:06:55 -0500 X-MC-Unique: XzlAEV4bNzqBYMfaImHEYg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B3BC10054FF; Fri, 18 Dec 2020 23:06:50 +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 F2473614FF; Fri, 18 Dec 2020 23:06:49 +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 362EF1809CA0; Fri, 18 Dec 2020 23:06:48 +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 0BIN6lO8026951 for ; Fri, 18 Dec 2020 18:06:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 568FE5D9EF; Fri, 18 Dec 2020 23:06:47 +0000 (UTC) Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3749A5D9D7; Fri, 18 Dec 2020 23:06:45 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 0BIN6h45009762; Fri, 18 Dec 2020 17:06:44 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 0BIN6hdQ009761; Fri, 18 Dec 2020 17:06:43 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Fri, 18 Dec 2020 17:06:37 -0600 Message-Id: <1608332802-9720-2-git-send-email-bmarzins@redhat.com> In-Reply-To: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> References: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH 1/6] mpathpersist: Fix Register and Ignore with 0x00 SARK 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com When the Register and Ignore command is run with sg_persist, if a 0x00 Service Action Reservation Key is given or the --param-sark option is not used at all, sg_persist will clear the registration. mpathpersist will fail with an error. This patch fixes mpathpersist to work like sg_persist in this case. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index 79322e86..41789c46 100644 --- a/libmpathpersist/mpath_persist.c +++ b/libmpathpersist/mpath_persist.c @@ -304,7 +304,8 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, } if (memcmp(paramp->key, &mpp->reservation_key, 8) && - memcmp(paramp->sa_key, &mpp->reservation_key, 8)) { + memcmp(paramp->sa_key, &mpp->reservation_key, 8) && + (prkey || rq_servact != MPATH_PROUT_REG_IGN_SA)) { condlog(0, "%s: configured reservation key doesn't match: 0x%" PRIx64, alias, get_be64(mpp->reservation_key)); ret = MPATH_PR_SYNTAX_ERROR; goto out1; From patchwork Fri Dec 18 23:06:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11983221 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5246BC3526D for ; Fri, 18 Dec 2020 23:07:20 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E675B23BA8 for ; Fri, 18 Dec 2020 23:07:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E675B23BA8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608332838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UIfrm6WksNT2vy5WA7esmh2bZTxUNxj3bV7DwF3J2mU=; b=Qd6157hMkPa+kQ5LTKW2bHFoINo2BPP4MqWOS8R5poPFTc7futOKDWOghHKl2K9Pa/WAY/ LNIiyLZEksvPGFWzYHRnqmbwKYbD+fJuraQ20BQUf0OHPb/MtC+ED8CxtNE1FP4zpFsspI 6GYwTqIIb9M9HCk0UTbsNg/YVC/dGP0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-927fi5IoMBi-WcJ-Hoe2Mg-1; Fri, 18 Dec 2020 18:07:07 -0500 X-MC-Unique: 927fi5IoMBi-WcJ-Hoe2Mg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B90E190D344; Fri, 18 Dec 2020 23:07:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3CB566E41D; Fri, 18 Dec 2020 23:07:01 +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 131B81C98; Fri, 18 Dec 2020 23:07:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.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 0BIN6nOE026971 for ; Fri, 18 Dec 2020 18:06:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id B7FF110016FF; Fri, 18 Dec 2020 23:06:49 +0000 (UTC) Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4739110016FA; Fri, 18 Dec 2020 23:06:46 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 0BIN6jk4009766; Fri, 18 Dec 2020 17:06:45 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 0BIN6iDI009765; Fri, 18 Dec 2020 17:06:44 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Fri, 18 Dec 2020 17:06:38 -0600 Message-Id: <1608332802-9720-3-git-send-email-bmarzins@redhat.com> In-Reply-To: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> References: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH 2/6] mpathpersist: update prkeys file on changing registrations 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com When the "reservation_key" option is set to "file" and Register command is run with both the current Reservation Key and a new Service Action Reservation Key, mpathpersist will change the registration, but will not update the prkeys file. This means that future paths that come online will not be able to register, since multipathd is still using the old reservation key. Fix this. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c index 41789c46..08077936 100644 --- a/libmpathpersist/mpath_persist.c +++ b/libmpathpersist/mpath_persist.c @@ -290,9 +290,10 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope, memcpy(&prkey, paramp->sa_key, 8); if (mpp->prkey_source == PRKEY_SOURCE_FILE && prkey && - ((!get_be64(mpp->reservation_key) && - rq_servact == MPATH_PROUT_REG_SA) || - rq_servact == MPATH_PROUT_REG_IGN_SA)) { + (rq_servact == MPATH_PROUT_REG_IGN_SA || + (rq_servact == MPATH_PROUT_REG_SA && + (!get_be64(mpp->reservation_key) || + memcmp(paramp->key, &mpp->reservation_key, 8) == 0)))) { memcpy(&mpp->reservation_key, paramp->sa_key, 8); if (update_prkey_flags(alias, get_be64(mpp->reservation_key), paramp->sa_flags)) { From patchwork Fri Dec 18 23:06:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11983213 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6172C4361B for ; Fri, 18 Dec 2020 23:07:02 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FFC423BA7 for ; Fri, 18 Dec 2020 23:07:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FFC423BA7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608332821; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6gCf1jeho2wBK5S+pKGfqMrXcf22giFG5F5jGcpY8yo=; b=O2dLMq4eHHZy2N0L8BL/Q3mgn0eFbdFzdmxR622+qcgrJVj0m/DdNnAo0Ma8cPcyRYtcPu XTF+Xq4XEJJ/IcFPtQb41fo/ecrJu1l0qJUa/YkGHHpBkfvFjJI/ofbc1xMtxNsfolPLo3 vOLRoDpgWV27ZUPKzWWGBTPI2zIhZyk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-531-RLyjnyiVM4ex6PMRYYvCcg-1; Fri, 18 Dec 2020 18:06:59 -0500 X-MC-Unique: RLyjnyiVM4ex6PMRYYvCcg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 301FC15727; Fri, 18 Dec 2020 23:06:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1072D10016FF; Fri, 18 Dec 2020 23:06:54 +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 DB1EA4BB7B; Fri, 18 Dec 2020 23:06:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BIN6oYo026977 for ; Fri, 18 Dec 2020 18:06:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id AAFBF5C1C5; Fri, 18 Dec 2020 23:06:50 +0000 (UTC) Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 315DD5C233; Fri, 18 Dec 2020 23:06:47 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 0BIN6jAV009770; Fri, 18 Dec 2020 17:06:46 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 0BIN6jBf009769; Fri, 18 Dec 2020 17:06:45 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Fri, 18 Dec 2020 17:06:39 -0600 Message-Id: <1608332802-9720-4-git-send-email-bmarzins@redhat.com> In-Reply-To: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> References: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH 3/6] libmultipath: warn about missing braces at end of multipath.conf 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Multipath doesn't warn when multipath.conf is missing closing braces at the end of the file. This has confused people about the correct config file syntax, so add a warning. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- libmultipath/parser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmultipath/parser.c b/libmultipath/parser.c index 163ffbc9..c70243c3 100644 --- a/libmultipath/parser.c +++ b/libmultipath/parser.c @@ -537,7 +537,7 @@ process_stream(struct config *conf, FILE *stream, vector keywords, if (!strcmp(str, EOB)) { if (kw_level > 0) { free_strvec(strvec); - break; + goto out; } condlog(0, "unmatched '%s' at line %d of %s", EOB, line_nr, file); @@ -576,7 +576,8 @@ process_stream(struct config *conf, FILE *stream, vector keywords, free_strvec(strvec); } - + if (kw_level == 1) + condlog(1, "missing '%s' at end of %s", EOB, file); out: FREE(buf); free_uniques(uniques); From patchwork Fri Dec 18 23:06:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11983215 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 179D0C4361B for ; Fri, 18 Dec 2020 23:07:19 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A50DA23BA7 for ; Fri, 18 Dec 2020 23:07:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A50DA23BA7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608332837; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Xtt+msuIRvFst6r+I4ESpie4w0dPlxILvTIjbyLH+9Q=; b=e/UxrSpWlfxITaPFPt59tP2m5Jxde24vS0oPhhmO44xF7vyyY2oyCDcKp22arQJTSy2DkF F6gDLPt6ahLIN2AScASrTfB07x1hnaNgjQQkLmeKVCCl25OiL9iZvWlSo1dQ0b3h9ilgQl 4p4wSepvwSmR/aHWbNRKPwxoOEuVlfs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-KySo_qpmN2-dBlGYHLWUzg-1; Fri, 18 Dec 2020 18:07:07 -0500 X-MC-Unique: KySo_qpmN2-dBlGYHLWUzg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F9BD107ACE3; Fri, 18 Dec 2020 23:07:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F2B22BFF1; Fri, 18 Dec 2020 23:07:01 +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 E54A04E590; Fri, 18 Dec 2020 23:07:00 +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 0BIN6pOI026985 for ; Fri, 18 Dec 2020 18:06:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7F507614FF; Fri, 18 Dec 2020 23:06:51 +0000 (UTC) Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DFF060CE7; Fri, 18 Dec 2020 23:06:48 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 0BIN6kU2009774; Fri, 18 Dec 2020 17:06:46 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 0BIN6kT9009773; Fri, 18 Dec 2020 17:06:46 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Fri, 18 Dec 2020 17:06:40 -0600 Message-Id: <1608332802-9720-5-git-send-email-bmarzins@redhat.com> In-Reply-To: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> References: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH 4/6] libmultipath: ignore multipaths sections without wwid option 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com "multipathd show config local" was crashing in find_mp_by_wwid() if the multipath configuration included a multipaths section that did not set a wwid option. There is no reason to keep a mpentry that didn't set its wwid. Remove it in merge_mptable(). Signed-off-by: Benjamin Marzinski --- libmultipath/config.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libmultipath/config.c b/libmultipath/config.c index 9f3cb38d..a643703e 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -509,6 +509,13 @@ void merge_mptable(vector mptable) int i, j; vector_foreach_slot(mptable, mp1, i) { + /* drop invalid multipath configs */ + if (!mp1->wwid) { + condlog(0, "multipaths config section missing wwid"); + vector_del_slot(mptable, i--); + free_mpe(mp1); + continue; + } j = i + 1; vector_foreach_slot_after(mptable, mp2, j) { if (strcmp(mp1->wwid, mp2->wwid)) From patchwork Fri Dec 18 23:06:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11983217 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 945CBC2D0E4 for ; Fri, 18 Dec 2020 23:07:19 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B4F023BA7 for ; Fri, 18 Dec 2020 23:07:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B4F023BA7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608332838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=n2V0OJeE4Q9lzNYvbECYWdZ1JcnC5/NGb18Z7RP2sjE=; b=hiVLH3IDvYBmxZ/gFOAMazbQL+tue/7YcfOz8/zXkVuonrIfn0SrgTO9aZFbKcfVBS6tnK wflewMBUPCpD3mIMVcUsDkTrcQcgXm0j5fWVCzETep/8fJgQWd/MOqv3selevWgk+3fA1U QKzgnpqs6hPzUpNf/G3lfiUhU6x/rfk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-GT7JWtXkOEmaeNctn4XLYA-1; Fri, 18 Dec 2020 18:07:08 -0500 X-MC-Unique: GT7JWtXkOEmaeNctn4XLYA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07E4115727; Fri, 18 Dec 2020 23:07:03 +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 E187660CE7; Fri, 18 Dec 2020 23:07:02 +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 B7E041809CA1; Fri, 18 Dec 2020 23:07:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BIN6q0I026996 for ; Fri, 18 Dec 2020 18:06:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6D6DF37A0; Fri, 18 Dec 2020 23:06:52 +0000 (UTC) Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 110AF5D769; Fri, 18 Dec 2020 23:06:49 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 0BIN6lMW009778; Fri, 18 Dec 2020 17:06:47 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 0BIN6lpE009777; Fri, 18 Dec 2020 17:06:47 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Fri, 18 Dec 2020 17:06:41 -0600 Message-Id: <1608332802-9720-6-git-send-email-bmarzins@redhat.com> In-Reply-To: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> References: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH 5/6] multipathd: Fix multipathd stopping on shutdown 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com According to man "systemd.special" "shutdown.target: ... Services that shall be terminated on system shutdown shall add Conflicts= and Before= dependencies to this unit for their service unit, which is implicitly done when DefaultDependencies=yes is set (the default)." multipathd.service sets DefaultDependencies=no and includes the Conflits= dependency, but not the Before= one. This can cause multipathd to continue running past when it is supposed to during shutdown. Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck --- multipathd/multipathd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/multipathd.service b/multipathd/multipathd.service index ba24983e..7d547fa7 100644 --- a/multipathd/multipathd.service +++ b/multipathd/multipathd.service @@ -2,7 +2,7 @@ Description=Device-Mapper Multipath Device Controller Wants=systemd-udev-trigger.service systemd-udev-settle.service Before=iscsi.service iscsid.service lvm2-activation-early.service -Before=local-fs-pre.target blk-availability.service +Before=local-fs-pre.target blk-availability.service shutdown.target After=multipathd.socket systemd-udev-trigger.service systemd-udev-settle.service DefaultDependencies=no Conflicts=shutdown.target From patchwork Fri Dec 18 23:06:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11983219 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FAACC3526C for ; Fri, 18 Dec 2020 23:07:20 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA70123BA7 for ; Fri, 18 Dec 2020 23:07:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA70123BA7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608332838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DO8r2QZgP62uuFbTJA/dPvfFxRGzb8ltqQGVyC6gQMM=; b=HwU6Tt78GgzF3WUkzeQxKefulmOwMBYI2ARsE4UciDLCkK9RPsKHByb698HQoONuFvtgm1 mFZeESzhdueu+N8JMFcyVuMB6oPQppz9x4yTbSi3roQrehBf5ibFPx06BRDfXI6ceCvhRZ 5GJ2wpkMcQBdxugANX2iu/PrfQBj4nk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-tmrMboMuMt-twV6JyDSDag-1; Fri, 18 Dec 2020 18:07:06 -0500 X-MC-Unique: tmrMboMuMt-twV6JyDSDag-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EA3F801817; Fri, 18 Dec 2020 23:07:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3F7BF2C161; Fri, 18 Dec 2020 23:07:01 +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 1943E5002C; Fri, 18 Dec 2020 23:07:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BIN6r0j027004 for ; Fri, 18 Dec 2020 18:06:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6074B60C61; Fri, 18 Dec 2020 23:06:53 +0000 (UTC) Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0572660C47; Fri, 18 Dec 2020 23:06:49 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 0BIN6mWK009782; Fri, 18 Dec 2020 17:06:48 -0600 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 0BIN6mwn009781; Fri, 18 Dec 2020 17:06:48 -0600 From: Benjamin Marzinski To: Christophe Varoqui Date: Fri, 18 Dec 2020 17:06:42 -0600 Message-Id: <1608332802-9720-7-git-send-email-bmarzins@redhat.com> In-Reply-To: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> References: <1608332802-9720-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH 6/6] multipath.conf.5: Improve checker_timeout description 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com I was asked to explain how checker_timeout works for checkers like directio, that don't issue scsi commands with an explicit timeout Signed-off-by: Benjamin Marzinski --- multipath/multipath.conf.5 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 index ea66a01e..c7c4184b 100644 --- a/multipath/multipath.conf.5 +++ b/multipath/multipath.conf.5 @@ -639,8 +639,13 @@ The default is: \fBno\fR . .TP .B checker_timeout -Specify the timeout to use for path checkers and prioritizers that issue SCSI -commands with an explicit timeout, in seconds. +Specify the timeout to use for path checkers and prioritizers, in seconds. +Only prioritizers that issue scsi commands use checker_timeout. Checkers +that support an asynchronous mode (\fItur\fR and \fIdirectio\fR), will +return shortly after being called by multipathd, regardless of whether the +storage array responds. If the storage array hasn't responded, mulitpathd will +check for a response every second, until \fIchecker_timeout\fR seconds have +elapsed. .RS .TP The default is: in \fB/sys/block/sd/device/timeout\fR