[dm-devel] [PATCH 24/42] Do not call sysfs_get_timeout for non-SCSI devices

Hannes Reinecke hare at suse.de
Tue Jan 8 13:54:02 UTC 2013


Only SCSI devices have a timeout, so there is no point in
trying to set a timeout for other types.

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 libmultipath/discovery.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 7ed8556..3ffdc62 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -761,11 +761,13 @@ get_state (struct path * pp, int daemon)
 	checker_clear_message(c);
 	if (daemon)
 		checker_set_async(c);
-	if (!conf->checker_timeout)
-		sysfs_get_timeout(pp, &(c->timeout));
+	if (!conf->checker_timeout &&
+	    (pp->bus != SYSFS_BUS_SCSI ||
+	     sysfs_get_timeout(pp, &(c->timeout))))
+		c->timeout = DEF_TIMEOUT;
 	state = checker_check(c);
 	condlog(3, "%s: state = %s", pp->dev, checker_state_name(state));
-	if (state == PATH_DOWN && strlen(checker_message(c)))
+	if (state != PATH_UP && strlen(checker_message(c)))
 		condlog(3, "%s: checker msg is \"%s\"",
 			pp->dev, checker_message(c));
 	return state;
-- 
1.7.4.2




More information about the dm-devel mailing list