diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/scsi_ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 2528a0c0dec8..65c6a3cba6d6 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -223,7 +223,7 @@ static int verify_command(struct file *file, unsigned char *cmd) | |||
223 | static int sg_io(struct file *file, request_queue_t *q, | 223 | static int sg_io(struct file *file, request_queue_t *q, |
224 | struct gendisk *bd_disk, struct sg_io_hdr *hdr) | 224 | struct gendisk *bd_disk, struct sg_io_hdr *hdr) |
225 | { | 225 | { |
226 | unsigned long start_time; | 226 | unsigned long start_time, timeout; |
227 | int writing = 0, ret = 0; | 227 | int writing = 0, ret = 0; |
228 | struct request *rq; | 228 | struct request *rq; |
229 | char sense[SCSI_SENSE_BUFFERSIZE]; | 229 | char sense[SCSI_SENSE_BUFFERSIZE]; |
@@ -271,7 +271,8 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
271 | 271 | ||
272 | rq->cmd_type = REQ_TYPE_BLOCK_PC; | 272 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
273 | 273 | ||
274 | rq->timeout = jiffies_to_msecs(hdr->timeout); | 274 | timeout = msecs_to_jiffies(hdr->timeout); |
275 | rq->timeout = (timeout < INT_MAX) ? timeout : INT_MAX; | ||
275 | if (!rq->timeout) | 276 | if (!rq->timeout) |
276 | rq->timeout = q->sg_timeout; | 277 | rq->timeout = q->sg_timeout; |
277 | if (!rq->timeout) | 278 | if (!rq->timeout) |