Skip to contentSkip to conversation

Convert jiffies to msecs in scsi_ioctl()

PATCH New Hannes Reinecke 1 participant 1 message Nov 9, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Convert jiffies to msecs in scsi_ioctl()

Hi all,

The attached patch fixes the conversion from jiffies to msecs in
scsi_ioctl(). The current code works if HZ=1000, but will lead to incorrect timeout settings for other values.

Please apply.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke			[email protected]
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

Fix conversion from jiffies to msecs for sg_io()

Use the proper conversion function for convert jiffies to msecs in sg_io().

block/scsi_ioctl.c +1 -1
index 2dc3264..ac63964 100644
@@ -304,7 +304,7 @@ static int sg_io(struct file *file, requ
 	if (rq->bio)
 		blk_queue_bounce(q, &rq->bio);
 
-	rq->timeout = (hdr->timeout * HZ) / 1000;
+	rq->timeout = jiffies_to_msecs(hdr->timeout);
 	if (!rq->timeout)
 		rq->timeout = q->sg_timeout;
 	if (!rq->timeout)
drivers/scsi/aic7xxx/aic79xx_osm.c +0 -0