From patchwork Mon Jul 15 13:00:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 2827475 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F1579C0AB2 for ; Mon, 15 Jul 2013 13:05:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38A3E2015C for ; Mon, 15 Jul 2013 13:05:35 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mail.kernel.org (Postfix) with ESMTP id C99EC20155 for ; Mon, 15 Jul 2013 13:05:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6FD27Dh015573; Mon, 15 Jul 2013 09:02:08 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6FD0f9D029047 for ; Mon, 15 Jul 2013 09:00:41 -0400 Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6FD0fQv015594 for ; Mon, 15 Jul 2013 09:00:41 -0400 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6FD0dJc031311 for ; Mon, 15 Jul 2013 09:00:39 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A1577A52C6; Mon, 15 Jul 2013 15:00:36 +0200 (CEST) From: Hannes Reinecke To: Christophe Varoqui Date: Mon, 15 Jul 2013 15:00:28 +0200 Message-Id: <1373893230-26077-28-git-send-email-hare@suse.de> In-Reply-To: <1373893230-26077-1-git-send-email-hare@suse.de> References: <1373893230-26077-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -7.69 (BAYES_00, DCC_REPUT_00_12, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, URIBL_BLOCKED) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.19 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH 27/29] Specify checker_timeout in seconds X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development 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-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 8d3f07da changed the internal value for checker_timeout to be in milliseconds, which wasn't reflected in the tur checker. So better scale it back to seconds, and change the callers to scale it to milliseconds where appropriate. Signed-off-by: Hannes Reinecke --- libmultipath/checkers/emc_clariion.c | 2 +- libmultipath/checkers/hp_sw.c | 4 ++-- libmultipath/checkers/libsg.c | 2 +- libmultipath/checkers/rdac.c | 4 ++-- libmultipath/checkers/tur.c | 2 +- libmultipath/discovery.c | 2 +- libmultipath/discovery.h | 2 +- libmultipath/propsel.c | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libmultipath/checkers/emc_clariion.c b/libmultipath/checkers/emc_clariion.c index 5d87bfd..a797734 100644 --- a/libmultipath/checkers/emc_clariion.c +++ b/libmultipath/checkers/emc_clariion.c @@ -114,7 +114,7 @@ int libcheck_check (struct checker * c) io_hdr.dxferp = sense_buffer; io_hdr.cmdp = inqCmdBlk; io_hdr.sbp = sb; - io_hdr.timeout = c->timeout; + io_hdr.timeout = c->timeout * 1000; io_hdr.pack_id = 0; if (ioctl(c->fd, SG_IO, &io_hdr) < 0) { MSG(c, "emc_clariion_checker: sending query command failed"); diff --git a/libmultipath/checkers/hp_sw.c b/libmultipath/checkers/hp_sw.c index b50ac0c..fe5e0f9 100644 --- a/libmultipath/checkers/hp_sw.c +++ b/libmultipath/checkers/hp_sw.c @@ -70,7 +70,7 @@ do_inq(int sg_fd, int cmddt, int evpd, unsigned int pg_op, io_hdr.dxferp = resp; io_hdr.cmdp = inqCmdBlk; io_hdr.sbp = sense_b; - io_hdr.timeout = timeout; + io_hdr.timeout = timeout * 1000; if (ioctl(sg_fd, SG_IO, &io_hdr) < 0) return 1; @@ -111,7 +111,7 @@ do_tur (int fd, unsigned int timeout) io_hdr.dxfer_direction = SG_DXFER_NONE; io_hdr.cmdp = turCmdBlk; io_hdr.sbp = sense_buffer; - io_hdr.timeout = timeout; + io_hdr.timeout = timeout * 1000; io_hdr.pack_id = 0; if (ioctl(fd, SG_IO, &io_hdr) < 0) diff --git a/libmultipath/checkers/libsg.c b/libmultipath/checkers/libsg.c index 5a989d3..0d3af1f 100644 --- a/libmultipath/checkers/libsg.c +++ b/libmultipath/checkers/libsg.c @@ -53,7 +53,7 @@ sg_read (int sg_fd, unsigned char * buff, int buff_len, io_hdr.dxferp = buff; io_hdr.mx_sb_len = sense_len; io_hdr.sbp = sense; - io_hdr.timeout = timeout; + io_hdr.timeout = timeout * 1000; io_hdr.pack_id = (int)start_block; if (diop && *diop) io_hdr.flags |= SG_FLAG_DIRECT_IO; diff --git a/libmultipath/checkers/rdac.c b/libmultipath/checkers/rdac.c index 5f24f55..2e64dd3 100644 --- a/libmultipath/checkers/rdac.c +++ b/libmultipath/checkers/rdac.c @@ -74,7 +74,7 @@ int libcheck_init (struct checker * c) io_hdr.dxferp = ¤t; io_hdr.cmdp = cmd; io_hdr.sbp = sense_b; - io_hdr.timeout = c->timeout; + io_hdr.timeout = c->timeout * 1000; if (ioctl(c->fd, SG_IO, &io_hdr) < 0) goto out; @@ -150,7 +150,7 @@ retry: io_hdr.dxferp = resp; io_hdr.cmdp = inqCmdBlk; io_hdr.sbp = sense_b; - io_hdr.timeout = timeout; + io_hdr.timeout = timeout * 1000; if (ioctl(sg_fd, SG_IO, &io_hdr) < 0) return 1; diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c index 6f5d4d9..b76dcec 100644 --- a/libmultipath/checkers/tur.c +++ b/libmultipath/checkers/tur.c @@ -116,7 +116,7 @@ tur_check(int fd, unsigned int timeout, char *msg) io_hdr.dxfer_direction = SG_DXFER_NONE; io_hdr.cmdp = turCmdBlk; io_hdr.sbp = sense_buffer; - io_hdr.timeout = timeout; + io_hdr.timeout = timeout * 1000; io_hdr.pack_id = 0; if (ioctl(fd, SG_IO, &io_hdr) < 0) { TUR_MSG(msg, MSG_TUR_DOWN); diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index c59dbc2..adfb1ba 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -204,7 +204,7 @@ sysfs_get_timeout(struct path *pp, unsigned int *timeout) return 1; } - *timeout = t * 1000; + *timeout = t; return 0; } diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h index 1a614ee..d049ead 100644 --- a/libmultipath/discovery.h +++ b/libmultipath/discovery.h @@ -14,7 +14,7 @@ #endif #ifndef DEF_TIMEOUT -#define DEF_TIMEOUT 300000 +#define DEF_TIMEOUT 30 #endif /* diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index cea8c1c..e47d0ca 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -347,8 +347,8 @@ select_checker(struct path *pp) pp->dev, checker_name(c)); out: if (conf->checker_timeout) { - c->timeout = conf->checker_timeout * 1000; - condlog(3, "%s: checker timeout = %u ms (config file default)", + c->timeout = conf->checker_timeout; + condlog(3, "%s: checker timeout = %u s (config file default)", pp->dev, c->timeout); } else if (pp->udev && sysfs_get_timeout(pp, &c->timeout) == 0)