diff mbox

multipath-tools libmultipath/discovery.c multi ...

Message ID 20100127172150.27153.qmail@sourceware.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

bmarzins@sourceware.org Jan. 27, 2010, 5:21 p.m. UTC
None
diff mbox

Patch

--- 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);