Commit:     c0d4d573feed199b16094c072e7cb07afb01c598
Parent:     87df7241bd547da5d4d4a4e5397866dfe422e439
Author:     Mike Christie <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 29 21:18:38 2007 -0500
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Jan 29 20:32:03 2007 -0800

    [PATCH] Fix SG_IO timeout jiffy conversion
    Commit 85e04e371b5a321b5df2bc3f8e0099a64fb087d7 cleaned up the timeout
    conversion, but did it exactly the wrong way.  We get msecs from user
    space, and should convert them into jiffies. Not the other way around.
    Here is a fix with the overflow check sg.c has added in.  This fixes DVD
    burnign with Nero.
    Signed-off-by: Mike Christie <[EMAIL PROTECTED]>
    [ "you'll be wanting a comma there" - Andrew ]
    Cc: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 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 2528a0c..65c6a3c 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -223,7 +223,7 @@ static int verify_command(struct file *file, unsigned char 
 static int sg_io(struct file *file, request_queue_t *q,
                struct gendisk *bd_disk, struct sg_io_hdr *hdr)
-       unsigned long start_time;
+       unsigned long start_time, timeout;
        int writing = 0, ret = 0;
        struct request *rq;
        char sense[SCSI_SENSE_BUFFERSIZE];
@@ -271,7 +271,8 @@ static int sg_io(struct file *file, request_queue_t *q,
        rq->cmd_type = REQ_TYPE_BLOCK_PC;
-       rq->timeout = jiffies_to_msecs(hdr->timeout);
+       timeout = msecs_to_jiffies(hdr->timeout);
+       rq->timeout = (timeout < INT_MAX) ? timeout : INT_MAX;
        if (!rq->timeout)
                rq->timeout = q->sg_timeout;
        if (!rq->timeout)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to