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 <hare@suse.de>
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");
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;
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)
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;
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;
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;
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);
return 1;
}
- *timeout = t * 1000;
+ *timeout = t;
return 0;
}
#endif
#ifndef DEF_TIMEOUT
-#define DEF_TIMEOUT 300000
+#define DEF_TIMEOUT 30
#endif
/*
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)