From patchwork Tue Nov 13 21:30:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 10681575 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 8DE7414E2 for ; Tue, 13 Nov 2018 21:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DCD02AFA7 for ; Tue, 13 Nov 2018 21:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70DA02B28B; Tue, 13 Nov 2018 21:46:56 +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 248FF2AFA7 for ; Tue, 13 Nov 2018 21:46:56 +0000 (UTC) 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 mx1.redhat.com (Postfix) with ESMTPS id 1574EA916; Tue, 13 Nov 2018 21:46:55 +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 CF840600D6; Tue, 13 Nov 2018 21:46: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 9A5D5181A86C; Tue, 13 Nov 2018 21:46:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wADLVV0L022708 for ; Tue, 13 Nov 2018 16:31:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id DA1B71974E; Tue, 13 Nov 2018 21:31:31 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0A9F45AB; Tue, 13 Nov 2018 21:31:23 +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 AE57030B9DEE; Tue, 13 Nov 2018 21:31:22 +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); Tue, 13 Nov 2018 14:31:13 -0700 From: Martin Wilck To: Christophe Varoqui , Benjamin Marzinski Date: Tue, 13 Nov 2018 22:30:52 +0100 Message-Id: <20181113213052.2009-3-mwilck@suse.com> In-Reply-To: <20181113213052.2009-1-mwilck@suse.com> References: <20181113213052.2009-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.49]); Tue, 13 Nov 2018 21:31:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 13 Nov 2018 21:31:23 +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.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Martin Wilck Subject: [dm-devel] [PATCH 2/2] multipathd: reset delay_wait_checks counter on failure 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 13 Nov 2018 21:46:55 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP If path reinstantiation is delayed by delay_wait_checks, wait_checks is counting down, the path fails during the delay phase, and then comes up again, the wait_check counter starts counting down at the same value where it previously stopped, which may be very low (even 1). To avoid that, reset the counter to pp->delay_wait_checks if a failure is encountered during the delay phase. Signed-off-by: Martin Wilck --- multipathd/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/multipathd/main.c b/multipathd/main.c index 0dddddb3..622aa1ac 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -2035,8 +2035,12 @@ check_path (struct vectors * vecs, struct path * pp, int ticks) pp->wait_checks = pp->mpp->delay_wait_checks; pp->watch_checks = 0; } - }else + } else { fail_path(pp, 0); + if (pp->wait_checks > 0) + pp->wait_checks = + pp->mpp->delay_wait_checks; + } /* * cancel scheduled failback