All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Mike Galbraith <efault@gmx.de>, Uwe Bugla <uwe.bugla@gmx.de>,
	Adrian Bunk <bunk@stusta.de>,
	gd@spherenet.de, alan@lxorguk.ukuu.org.uk,
	linux-ide@vger.kernel.org, B.Zolnierkiewicz@elka.pw.edu.pl,
	Jeff Garzik <jgarzik@pobox.com>,
	Jens Axboe <jens.axboe@oracle.com>,
	James Bottomley <James.Bottomley@SteelEye.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Boaz Harrosh <bharrosh@panasas.com>
Subject: Re: 2.6.20-rc6: known unfixed regressions (v2) (part 2)
Date: Mon, 29 Jan 2007 21:18:38 -0500	[thread overview]
Message-ID: <1170123518.2376.2.camel@max> (raw)
In-Reply-To: <20070129190847.6ef1191f.akpm@osdl.org>

On Mon, 2007-01-29 at 19:08 -0800, Andrew Morton wrote:
> On Mon, 29 Jan 2007 20:50:58 -0600
> Mike Christie <michaelc@cs.wisc.edu> wrote:
> 
> > With the attached patch, nero finds the cd drives and I can burn disks.
> > There is no errors from the ide layer like before.
> > 
> > 
> > [use-old-timeout-calc.patch  text/x-patch (399B)]
> > diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
> > index 2528a0c..aded9a0 100644
> > --- a/block/scsi_ioctl.c
> > +++ b/block/scsi_ioctl.c
> > @@ -271,7 +271,7 @@ static int sg_io(struct file *file, requ
> >  
> >  	rq->cmd_type = REQ_TYPE_BLOCK_PC;
> >  
> > -	rq->timeout = jiffies_to_msecs(hdr->timeout);
> > +	rq->timeout = (hdr->timeout * HZ) / 1000;
> 
> Yes, that was a buggy conversion - it should have been msecs_to_jiffies().

Ok. here is a fix with the overflow check sg.c has. Patch
was made against Linus's tree and tested with nero.

Userspace does not send us jiffies. Use msecs_to_jiffies
and check for overflow like sg.c

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 2528a0c..5ca72c5 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -223,7 +223,7 @@ static int verify_command(struct file *f
 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, requ
 
 	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)



  reply	other threads:[~2007-01-30  3:33 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25  2:58 Linux 2.6.20-rc6 Linus Torvalds
2007-01-25 10:09 ` Sunil Naidu
2007-01-25 11:10 ` Linux 2.6.20-rc6 - build failure Eyal Lebedinsky
2007-01-26  2:22   ` Eyal Lebedinsky
2007-01-26 10:49     ` [Ocfs2-devel] [2.6 patch] fix OCFS2 compile error Adrian Bunk
2007-01-26 18:49       ` Adrian Bunk
2007-01-26 11:47       ` [Ocfs2-devel] " Mark Fasheh
2007-01-26 19:47         ` Mark Fasheh
2007-01-26 11:53         ` [Ocfs2-devel] " Adrian Bunk
2007-01-26 19:53           ` Adrian Bunk
2007-01-26 18:46   ` Linux 2.6.20-rc6 - build failure Mark Fasheh
2007-01-25 17:50 ` Linux 2.6.20-rc6 Arkadiusz Patyk
2007-01-25 21:05 ` Michal Piotrowski
2007-01-25 21:12   ` David Miller
2007-01-26 16:52     ` Venkat Yekkirala
2007-01-26 18:10 ` 2.6.20-rc6: known unfixed regressions (part 1) Adrian Bunk
2007-01-26 18:11 ` 2.6.20-rc6: known unfixed regressions (part 2) Adrian Bunk
2007-01-26 18:11   ` Adrian Bunk
2007-01-26 18:11   ` Adrian Bunk
2007-01-26 18:16   ` Malte Schröder
2007-01-27 17:28     ` Adrian Bunk
2007-01-27 17:39       ` Adrian Bunk
2007-01-27 17:58       ` Linus Torvalds
2007-01-26 19:04   ` Michal Piotrowski
2007-01-26 19:04     ` Michal Piotrowski
2007-01-26 19:04     ` Michal Piotrowski
2007-01-26 19:08     ` Venkat Yekkirala
2007-01-26 18:18 ` 2.6.20-rc6: known regressions with patches Adrian Bunk
2007-01-29  8:45   ` Ingo Molnar
2007-01-29 12:58     ` Dave Jones
2007-01-27 17:32 ` 2.6.20-rc6: known unfixed regressions (v2) (part 1) Adrian Bunk
2007-01-27 17:42 ` 2.6.20-rc6: known unfixed regressions (v2) (part 2) Adrian Bunk
2007-01-27 17:42   ` Adrian Bunk
2007-01-28 13:33   ` Uwe Bugla
2007-01-28 13:33     ` Uwe Bugla
2007-01-28 23:21     ` Andrew Morton
2007-02-02 12:58       ` Uwe Bugla
2007-01-29  6:26     ` Mike Galbraith
2007-01-29  6:26       ` Mike Galbraith
2007-01-29  6:48       ` Andrew Morton
2007-01-29  6:48         ` Andrew Morton
2007-01-29  7:08         ` Mike Galbraith
2007-01-29  7:08           ` Mike Galbraith
2007-01-29  7:13           ` Linus Torvalds
2007-01-29  7:13             ` Linus Torvalds
2007-01-29  7:04       ` Linus Torvalds
2007-01-29  7:19         ` Mike Galbraith
2007-01-29 10:01         ` Mike Galbraith
2007-01-29 18:16           ` Mike Galbraith
2007-01-29 18:43             ` Linus Torvalds
2007-01-30  4:14               ` Mike Galbraith
2007-01-29 17:16         ` Mike Christie
2007-01-29 20:37         ` Mike Christie
2007-01-29 20:58           ` Linus Torvalds
2007-01-29 22:16             ` Linus Torvalds
2007-01-29 23:01               ` Linus Torvalds
2007-01-29 23:32                 ` Linus Torvalds
2007-01-29 23:42                   ` Mike Christie
2007-01-30  0:23                     ` Linus Torvalds
2007-01-30  0:55                       ` Mike Christie
2007-01-30  1:04                         ` Mike Christie
2007-01-30  1:45                           ` Linus Torvalds
2007-01-30  2:50                             ` Mike Christie
2007-01-30  3:02                               ` Mike Christie
2007-01-30  3:08                               ` Andrew Morton
2007-01-30  2:18                                 ` Mike Christie [this message]
2007-01-30  3:33                                   ` Andrew Morton
2007-01-30  4:44                                   ` Linus Torvalds
2007-01-30  4:00                                 ` Mike Galbraith
2007-01-30  3:25           ` Mike Galbraith
2007-01-30  4:14           ` Jeff Garzik
2007-02-02 13:07         ` Uwe Bugla
2007-01-27 17:44 ` 2.6.20-rc6: known regressions with patches (v2) Adrian Bunk
2007-01-27 20:47 ` Linux 2.6.20-rc6 - supend lockdep warning Thomas Gleixner
2007-01-27 20:55 ` Linux 2.6.20-rc6 - sky2 resume breakage Thomas Gleixner
2007-01-29 19:31   ` Stephen Hemminger
2007-01-29 20:10     ` Thomas Gleixner
2007-01-29 21:38       ` Stephen Hemminger
2007-01-29 22:23         ` Thomas Gleixner
2007-01-29 22:23           ` Stephen Hemminger
2007-01-29 22:31             ` Thomas Gleixner
2007-01-29 22:37           ` Linus Torvalds
2007-01-29 22:40             ` Stephen Hemminger
2007-01-29 23:04               ` Linus Torvalds
2007-01-29 23:45                 ` Stephen Hemminger
2007-01-30  0:12                   ` Linus Torvalds
2007-01-30  0:16                     ` Stephen Hemminger
2007-01-30  0:25                       ` Linus Torvalds
2007-01-30  0:26                         ` Stephen Hemminger
2007-01-30  0:38                         ` [PATCH] sky2: revert IRQ dance on suspend/resume Stephen Hemminger
2007-01-30  0:43                           ` Linus Torvalds
2007-01-30  0:41                             ` Stephen Hemminger
2007-01-30  6:54                         ` Linux 2.6.20-rc6 - sky2 resume breakage Ingo Molnar
2007-01-30  7:39                           ` Jeff Garzik
2007-01-30  7:53                             ` Ingo Molnar
2007-01-30  8:02                               ` Jeff Garzik
2007-01-30  8:08                                 ` Ingo Molnar
2007-01-30  8:13                                   ` Ingo Molnar
2007-01-31 15:27                                   ` Jeff Garzik
2007-01-31 17:38                                     ` Ingo Molnar
2007-01-31 17:52                                       ` Jeff Garzik
2007-01-31 20:13                                         ` Thomas Gleixner
2007-01-30  8:03                             ` Ingo Molnar
2007-02-01  6:15                             ` [LIBATA BUG] sr.c: TEST_UNIT_READY error Conke Hu
2007-02-07 12:40                               ` Jeff Garzik
2007-02-02  5:48                                 ` Conke Hu
2007-02-13  7:30                                   ` Conke Hu
2007-02-15  6:30                                     ` Conke Hu
2007-01-30  8:57                     ` Linux 2.6.20-rc6 - sky2 resume breakage Len Brown
2007-01-30 16:01                       ` Rafael J. Wysocki
2007-01-30 21:28                         ` Nigel Cunningham
2007-02-01 12:49                       ` Pavel Machek
2007-01-29 23:42             ` [PATCH] sky2: fix MSI related " Thomas Gleixner
2007-01-29 22:38           ` Linux 2.6.20-rc6 - sky2 " Frédéric Riss
2007-01-29 22:45             ` Thomas Gleixner
2007-01-29 22:50               ` Frédéric Riss
2007-01-29 22:57                 ` Thomas Gleixner
2007-01-29 23:26                   ` Frédéric Riss
2007-01-29 23:37                     ` Thomas Gleixner
2007-01-29 23:50                       ` [PATCH] block MSI on Sony Stephen Hemminger
2007-01-30  0:22                         ` Thomas Gleixner
2007-01-30  0:21                           ` Stephen Hemminger
2007-01-30  0:31                             ` Thomas Gleixner
2007-01-30  0:31                               ` Stephen Hemminger
2007-01-30  0:26                           ` Thomas Gleixner
2007-01-27 22:11 ` Linux 2.6.20-rc6 - suspend / resume ata_piix Thomas Gleixner
2007-01-27 22:40   ` Jeff Garzik
2007-01-27 22:44     ` Thomas Gleixner
2007-01-28 22:05       ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1170123518.2376.2.camel@max \
    --to=michaelc@cs.wisc.edu \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=James.Bottomley@SteelEye.com \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bharrosh@panasas.com \
    --cc=bunk@stusta.de \
    --cc=efault@gmx.de \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=gd@spherenet.de \
    --cc=jens.axboe@oracle.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=uwe.bugla@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.