Do not call sysfs_get_timeout for non-SCSI devices
authorHannes Reinecke <hare@suse.de>
Tue, 8 Jan 2013 13:54:02 +0000 (14:54 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 8 Jan 2013 22:49:09 +0000 (23:49 +0100)
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@suse.de>
libmultipath/discovery.c

index 7ed8556..3ffdc62 100644 (file)
@@ -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;