block: use jiffies conversion functions in scsi_ioctl.c

Use msecs_to_jiffies() and jiffies_to_msecs() in scsi_ioctl().
Sometimes callers use very large values for e.g. vendor specific media
clear command and calculation can overflow.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by Tejun Heo and committed by Jens Axboe 24bb8fb9 c63a1190

+2 -2
+2 -2
block/scsi_ioctl.c
··· 230 230 rq->cmd_len = hdr->cmd_len; 231 231 rq->cmd_type = REQ_TYPE_BLOCK_PC; 232 232 233 - rq->timeout = (hdr->timeout * HZ) / 1000; 233 + rq->timeout = msecs_to_jiffies(hdr->timeout); 234 234 if (!rq->timeout) 235 235 rq->timeout = q->sg_timeout; 236 236 if (!rq->timeout) ··· 366 366 */ 367 367 blk_execute_rq(q, bd_disk, rq, 0); 368 368 369 - hdr->duration = ((jiffies - start_time) * 1000) / HZ; 369 + hdr->duration = jiffies_to_msecs(jiffies - start_time); 370 370 371 371 return blk_complete_sghdr_rq(rq, hdr, bio); 372 372 out: