From patchwork Thu Jul 9 10:19:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11654087 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D749560D for ; Thu, 9 Jul 2020 10:21:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 892CD2076A for ; Thu, 9 Jul 2020 10:21:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 892CD2076A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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-133-a69g0ijBPHC8AxT4_USo-w-1; Thu, 09 Jul 2020 06:21:53 -0400 X-MC-Unique: a69g0ijBPHC8AxT4_USo-w-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 E342E19253C9; Thu, 9 Jul 2020 10:21:48 +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 AA43510023A7; Thu, 9 Jul 2020 10:21:48 +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 8373393F85; Thu, 9 Jul 2020 10:21:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069AKGsq030212 for ; Thu, 9 Jul 2020 06:20:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5157A2156A54; Thu, 9 Jul 2020 10:20:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D3332157F24 for ; Thu, 9 Jul 2020 10:20:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2159A185A797 for ; Thu, 9 Jul 2020 10:20:15 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-Cm4MjsUdOnqQGVYCZgGZhw-1; Thu, 09 Jul 2020 06:20:09 -0400 X-MC-Unique: Cm4MjsUdOnqQGVYCZgGZhw-1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7268FB071; Thu, 9 Jul 2020 10:20:07 +0000 (UTC) From: mwilck@suse.com To: Christophe Varoqui , Benjamin Marzinski Date: Thu, 9 Jul 2020 12:19:49 +0200 Message-Id: <20200709101952.7285-2-mwilck@suse.com> In-Reply-To: <20200709101952.7285-1-mwilck@suse.com> References: <20200709101952.7285-1-mwilck@suse.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 069AKGsq030212 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Martin Wilck Subject: [dm-devel] [PATCH 36/39] libmultipath: add macro DEV_LOSS_TMO_UNSET 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.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 From: Martin Wilck The special value 0 means "unset" for dev_loss. Make this more explicit by using a macro. Signed-off-by: Martin Wilck --- libmultipath/defaults.h | 1 + libmultipath/dict.c | 4 ++-- libmultipath/discovery.c | 12 +++++++----- libmultipath/propsel.c | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h index 0574e8f..39a5e41 100644 --- a/libmultipath/defaults.h +++ b/libmultipath/defaults.h @@ -58,6 +58,7 @@ #define CHECKINT_UNDEF UINT_MAX #define DEFAULT_CHECKINT 5 +#define DEV_LOSS_TMO_UNSET 0U #define MAX_DEV_LOSS_TMO UINT_MAX #define DEFAULT_PIDFILE "/" RUN_DIR "/multipathd.pid" #define DEFAULT_SOCKET "/org/kernel/linux/storage/multipathd" diff --git a/libmultipath/dict.c b/libmultipath/dict.c index 0e9ea38..be3029c 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -873,7 +873,7 @@ set_dev_loss(vector strvec, void *ptr) if (!strcmp(buff, "infinity")) *uint_ptr = MAX_DEV_LOSS_TMO; else if (sscanf(buff, "%u", uint_ptr) != 1) - *uint_ptr = 0; + *uint_ptr = DEV_LOSS_TMO_UNSET; FREE(buff); return 0; @@ -882,7 +882,7 @@ set_dev_loss(vector strvec, void *ptr) int print_dev_loss(char * buff, int len, unsigned long v) { - if (!v) + if (v == DEV_LOSS_TMO_UNSET) return 0; if (v >= MAX_DEV_LOSS_TMO) return snprintf(buff, len, "\"infinity\""); diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 81a3fad..f7d6672 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -671,7 +671,7 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) rport_id, value, -ret); } } - if (mpp->dev_loss > 0) { + if (mpp->dev_loss != DEV_LOSS_TMO_UNSET) { snprintf(value, 16, "%u", mpp->dev_loss); ret = sysfs_attr_set_value(rport_dev, "dev_loss_tmo", value, strlen(value)); @@ -705,7 +705,7 @@ sysfs_set_session_tmo(struct multipath *mpp, struct path *pp) condlog(4, "target%d:%d:%d -> %s", pp->sg_id.host_no, pp->sg_id.channel, pp->sg_id.scsi_id, session_id); - if (mpp->dev_loss) { + if (mpp->dev_loss != DEV_LOSS_TMO_UNSET) { condlog(3, "%s: ignoring dev_loss_tmo on iSCSI", pp->dev); } if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) { @@ -747,7 +747,7 @@ sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp) condlog(4, "target%d:%d:%d -> %s", pp->sg_id.host_no, pp->sg_id.channel, pp->sg_id.scsi_id, end_dev_id); - if (mpp->dev_loss) { + if (mpp->dev_loss != DEV_LOSS_TMO_UNSET) { snprintf(value, 11, "%u", mpp->dev_loss); if (sysfs_attr_set_value(sas_dev, "I_T_nexus_loss_timeout", value, strlen(value)) <= 0) @@ -782,13 +782,15 @@ sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint) mpp->alias, dev_loss_tmo); } mpp->dev_loss = dev_loss_tmo; - if (mpp->dev_loss && mpp->fast_io_fail > 0 && + if (mpp->dev_loss != DEV_LOSS_TMO_UNSET && + mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET && (unsigned int)mpp->fast_io_fail >= mpp->dev_loss) { condlog(3, "%s: turning off fast_io_fail (%d is not smaller than dev_loss_tmo)", mpp->alias, mpp->fast_io_fail); mpp->fast_io_fail = MP_FAST_IO_FAIL_OFF; } - if (!mpp->dev_loss && mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET) + if (mpp->dev_loss == DEV_LOSS_TMO_UNSET && + mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET) return 0; vector_foreach_slot(mpp->paths, pp, i) { diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index 2233527..555bd96 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -766,7 +766,7 @@ int select_dev_loss(struct config *conf, struct multipath *mp) mp_set_ovr(dev_loss); mp_set_hwe(dev_loss); mp_set_conf(dev_loss); - mp->dev_loss = 0; + mp->dev_loss = DEV_LOSS_TMO_UNSET; return 0; out: print_dev_loss(buff, 12, mp->dev_loss); From patchwork Thu Jul 9 10:19:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11654059 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5C109618 for ; Thu, 9 Jul 2020 10:20:28 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F4432067D for ; Thu, 9 Jul 2020 10:20:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F4432067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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-39-F8bQoNY6PnC-4qkEPD5_7A-1; Thu, 09 Jul 2020 06:20:24 -0400 X-MC-Unique: F8bQoNY6PnC-4qkEPD5_7A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D2EFC107B0F0; Thu, 9 Jul 2020 10:20:18 +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 B2D107F8A5; Thu, 9 Jul 2020 10:20: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 5E44693F81; Thu, 9 Jul 2020 10:20:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069AKGRi030206 for ; Thu, 9 Jul 2020 06:20:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id E394E2026D67; Thu, 9 Jul 2020 10:20:15 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF31E208DD8A for ; Thu, 9 Jul 2020 10:20:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ADBE010DCE81 for ; Thu, 9 Jul 2020 10:20:13 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-97-WyzIqHwtOi2RTUnirXbi6w-1; Thu, 09 Jul 2020 06:20:09 -0400 X-MC-Unique: WyzIqHwtOi2RTUnirXbi6w-1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A6CBCB077; Thu, 9 Jul 2020 10:20:07 +0000 (UTC) From: mwilck@suse.com To: Christophe Varoqui , Benjamin Marzinski Date: Thu, 9 Jul 2020 12:19:50 +0200 Message-Id: <20200709101952.7285-3-mwilck@suse.com> In-Reply-To: <20200709101952.7285-1-mwilck@suse.com> References: <20200709101952.7285-1-mwilck@suse.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 069AKGRi030206 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Martin Wilck Subject: [dm-devel] [PATCH 37/39] libmultipath: improve logging for dev_loss_tmo override 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.15 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 From: Martin Wilck Print a more meaningful warning message, and at higher level, if the configured dev_loss_tmo can't be applied because it conflicts with no_path_retry. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index f7d6672..e2aea81 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -774,14 +774,15 @@ sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint) no_path_retry_tmo = MAX_DEV_LOSS_TMO; if (no_path_retry_tmo > dev_loss_tmo) dev_loss_tmo = no_path_retry_tmo; - condlog(3, "%s: update dev_loss_tmo to %u", - mpp->alias, dev_loss_tmo); } else if (mpp->no_path_retry == NO_PATH_RETRY_QUEUE) { dev_loss_tmo = MAX_DEV_LOSS_TMO; - condlog(3, "%s: update dev_loss_tmo to %u", - mpp->alias, dev_loss_tmo); } - mpp->dev_loss = dev_loss_tmo; + if (mpp->dev_loss != DEV_LOSS_TMO_UNSET && + mpp->dev_loss != dev_loss_tmo) { + condlog(2, "%s: Using dev_loss_tmo=%u instead of %u because of no_path_retry setting", + mpp->alias, dev_loss_tmo, mpp->dev_loss); + mpp->dev_loss = dev_loss_tmo; + } if (mpp->dev_loss != DEV_LOSS_TMO_UNSET && mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET && (unsigned int)mpp->fast_io_fail >= mpp->dev_loss) { From patchwork Thu Jul 9 10:19:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11654061 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7454060D for ; Thu, 9 Jul 2020 10:20:29 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AC602067D for ; Thu, 9 Jul 2020 10:20:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AC602067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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-316-JyiX48nZMUWhQKzN7jepXw-1; Thu, 09 Jul 2020 06:20:25 -0400 X-MC-Unique: JyiX48nZMUWhQKzN7jepXw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72C4419253C7; Thu, 9 Jul 2020 10:20:20 +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 55AC45D9C9; Thu, 9 Jul 2020 10:20:20 +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 2B8201809547; Thu, 9 Jul 2020 10:20:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069AKGan030213 for ; Thu, 9 Jul 2020 06:20:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 514FF2157F25; Thu, 9 Jul 2020 10:20:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CDA82166BA4 for ; Thu, 9 Jul 2020 10:20:14 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 233EA856A54 for ; Thu, 9 Jul 2020 10:20:14 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-380-pVfIaqkOMxS30hPs-EJ4ow-1; Thu, 09 Jul 2020 06:20:09 -0400 X-MC-Unique: pVfIaqkOMxS30hPs-EJ4ow-1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DB4C0B07D; Thu, 9 Jul 2020 10:20:07 +0000 (UTC) From: mwilck@suse.com To: Christophe Varoqui , Benjamin Marzinski Date: Thu, 9 Jul 2020 12:19:51 +0200 Message-Id: <20200709101952.7285-4-mwilck@suse.com> In-Reply-To: <20200709101952.7285-1-mwilck@suse.com> References: <20200709101952.7285-1-mwilck@suse.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 069AKGan030213 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Martin Wilck Subject: [dm-devel] [PATCH 38/39] libmultipath: print message if setting dev_loss_tmo is unsupported 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.14 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 From: Martin Wilck If dev_loss_tmo can't be set because it's not supported for the protocol at hand, let the user know. Fixme: we could implement this for other protocols such as NVMe. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index e2aea81..c00af7e 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -33,6 +33,8 @@ #include "unaligned.h" #include "prioritizers/alua_rtpg.h" #include "foreign.h" +#include "configure.h" +#include "print.h" struct vpd_vendor_page vpd_vendor_pages[VPD_VP_ARRAY_SIZE] = { [VPD_VP_UNDEF] = { 0x00, "undef" }, @@ -765,6 +767,7 @@ sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint) struct path *pp; int i; unsigned int dev_loss_tmo = mpp->dev_loss; + struct path *err_path = NULL; if (mpp->no_path_retry > 0) { uint64_t no_path_retry_tmo = @@ -795,12 +798,34 @@ sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint) return 0; vector_foreach_slot(mpp->paths, pp, i) { - if (pp->sg_id.proto_id == SCSI_PROTOCOL_FCP) + if (pp->bus != SYSFS_BUS_SCSI) { + if (!err_path) + err_path = pp; + continue; + } + + switch (pp->sg_id.proto_id) { + case SCSI_PROTOCOL_FCP: sysfs_set_rport_tmo(mpp, pp); - if (pp->sg_id.proto_id == SCSI_PROTOCOL_ISCSI) + continue; + case SCSI_PROTOCOL_ISCSI: sysfs_set_session_tmo(mpp, pp); - if (pp->sg_id.proto_id == SCSI_PROTOCOL_SAS) + continue; + case SCSI_PROTOCOL_SAS: sysfs_set_nexus_loss_tmo(mpp, pp); + continue; + default: + if (!err_path) + err_path = pp; + } + } + + if (err_path) { + char proto_buf[32]; + + snprint_path_protocol(proto_buf, sizeof(proto_buf), err_path); + condlog(2, "%s: setting dev_loss_tmo is unsupported for protocol %s", + mpp->alias, proto_buf); } return 0; } From patchwork Thu Jul 9 10:19:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 11654057 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D7BF618 for ; Thu, 9 Jul 2020 10:20:27 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3379C2067D for ; Thu, 9 Jul 2020 10:20:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3379C2067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com 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-366-GHnQe8pCOx61FZXqx8F6Rg-1; Thu, 09 Jul 2020 06:20:24 -0400 X-MC-Unique: GHnQe8pCOx61FZXqx8F6Rg-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 4B33B19253C0; Thu, 9 Jul 2020 10:20:18 +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 2796990E60; Thu, 9 Jul 2020 10:20:18 +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 CFA9193F8E; Thu, 9 Jul 2020 10:20:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069AKGLB030214 for ; Thu, 9 Jul 2020 06:20:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 53CD22156A59; Thu, 9 Jul 2020 10:20:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CD162166B28 for ; Thu, 9 Jul 2020 10:20:16 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2C268007CB for ; Thu, 9 Jul 2020 10:20:15 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-462-fhs_5fqtNXeYdeoKjugbwQ-1; Thu, 09 Jul 2020 06:20:09 -0400 X-MC-Unique: fhs_5fqtNXeYdeoKjugbwQ-1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1AACDB080; Thu, 9 Jul 2020 10:20:08 +0000 (UTC) From: mwilck@suse.com To: Christophe Varoqui , Benjamin Marzinski Date: Thu, 9 Jul 2020 12:19:52 +0200 Message-Id: <20200709101952.7285-5-mwilck@suse.com> In-Reply-To: <20200709101952.7285-1-mwilck@suse.com> References: <20200709101952.7285-1-mwilck@suse.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 069AKGLB030214 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Martin Wilck Subject: [dm-devel] [PATCH 39/39] libmultipath: increase log level of limiting dev_loss_tmo 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.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 From: Martin Wilck Users who aren't familar with the complex dependencies between dev_loss_tmo, no_path_retry, and fast_io_fail may be confused if their settings aren't applied. Print this log message at the default level. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index c00af7e..e26aae2 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -651,7 +651,7 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp) } } else if (mpp->dev_loss > DEFAULT_DEV_LOSS_TMO && mpp->no_path_retry != NO_PATH_RETRY_QUEUE) { - condlog(3, "%s: limiting dev_loss_tmo to %d, since " + condlog(2, "%s: limiting dev_loss_tmo to %d, since " "fast_io_fail is not set", rport_id, DEFAULT_DEV_LOSS_TMO); mpp->dev_loss = DEFAULT_DEV_LOSS_TMO;