Re: Issuing a vendor specific ATA cmd on SATA Disk via ATA Pass Thru

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sam song wrote:
=>> Hmmm... It's timeout.  How long does the command take?  It's a bit weird
>> because 36000s but the reported command duration is 136s.  How long did
>> the command take actually?
> 
> The command did actually take 136minutes25seconds. I set the timeout in app
> as 36000seconds(10-hour). 

Right, 136m.  I wonder whether it's hitting some hard timeout limit in
the kernel.  Hmmmm... Does the attached patch fix your problem?

Thanks.

-- 
tejun
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 91c7322..9675b34 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -230,7 +230,7 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
 	rq->cmd_len = hdr->cmd_len;
 	rq->cmd_type = REQ_TYPE_BLOCK_PC;
 
-	rq->timeout = (hdr->timeout * HZ) / 1000;
+	rq->timeout = msecs_to_jiffies(hdr->timeout);
 	if (!rq->timeout)
 		rq->timeout = q->sg_timeout;
 	if (!rq->timeout)
@@ -366,7 +366,7 @@ static int sg_io(struct file *file, struct request_queue *q,
 	 */
 	blk_execute_rq(q, bd_disk, rq, 0);
 
-	hdr->duration = ((jiffies - start_time) * 1000) / HZ;
+	hdr->duration = jiffies_to_msecs(jiffies - start_time);
 
 	return blk_complete_sghdr_rq(rq, hdr, bio);
 out:

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux