From patchwork Wed Jan 27 17:21:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bmarzins@sourceware.org X-Patchwork-Id: 75492 Received: from mx01.util.phx2.redhat.com (mx1-phx2.redhat.com [209.132.183.26]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0RHOEDV005516 for ; Wed, 27 Jan 2010 17:24:14 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.util.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0RHM8iT028477; Wed, 27 Jan 2010 12:22:09 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0RHM7TN029075 for ; Wed, 27 Jan 2010 12:22:07 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.10]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0RHM2WT024518 for ; Wed, 27 Jan 2010 12:22:02 -0500 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by mx1.redhat.com (8.13.8/8.13.8) with SMTP id o0RHLoW6000862 for ; Wed, 27 Jan 2010 12:21:50 -0500 Received: (qmail 27155 invoked by uid 9475); 27 Jan 2010 17:21:50 -0000 Date: 27 Jan 2010 17:21:50 -0000 Message-ID: <20100127172150.27153.qmail@sourceware.org> From: bmarzins@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -1.75 (AWL) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.10 X-loop: dm-devel@redhat.com Subject: [dm-devel] multipath-tools libmultipath/discovery.c multi ... 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 --- multipath-tools/libmultipath/discovery.c 2010/01/27 16:46:48 1.32.2.11 +++ multipath-tools/libmultipath/discovery.c 2010/01/27 17:21:48 1.32.2.12 @@ -242,7 +242,7 @@ { struct sysfs_attribute * attr; char attr_path[SYSFS_PATH_SIZE]; - int r; + int t, r; if (safe_sprintf(attr_path, "%s/block/%s/device/timeout", sysfs_path, dev)) @@ -256,12 +256,13 @@ if (0 > sysfs_read_attribute(attr)) goto out; - r = sscanf(attr->value, "%u\n", timeout); + r = sscanf(attr->value, "%u\n", &t); sysfs_close_attribute(attr); if (r != 1) return 1; + *timeout = t; return 0; out: sysfs_close_attribute(attr); --- multipath-tools/multipathd/main.c 2009/11/02 19:11:46 1.69.2.25 +++ multipath-tools/multipathd/main.c 2010/01/27 17:21:48 1.69.2.26 @@ -979,8 +979,12 @@ */ checker_set_async(&pp->checker); - if (check_sysfs_state(pp, &newstate) == 0) + if (check_sysfs_state(pp, &newstate) == 0) { + if (!conf->checker_timeout) + sysfs_get_timeout(sysfs_path, pp->dev, + &(pp->checker.timeout)); newstate = checker_check(&pp->checker); + } if (newstate < 0) { condlog(2, "%s: unusable path", pp->dev);