lkml.org 
[lkml]   [2008]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Oops when using growisofs
On Thu, Jun 26 2008, Michael Buesch wrote:
> On Thursday 26 June 2008 20:36:11 Jens Axboe wrote:
> > Something like this, totally untested...
> >
> > diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> > index 68e7f19..5c1e663 100644
> > --- a/drivers/ide/ide-cd.c
> > +++ b/drivers/ide/ide-cd.c
> > @@ -1308,13 +1308,29 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
> > req.cmd_flags |= REQ_QUIET;
> >
> > stat = ide_cd_queue_pc(drive, &req);
> > - if (stat == 0) {
> > - *capacity = 1 + be32_to_cpu(capbuf.lba);
> > - *sectors_per_frame =
> > - be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
> > + if (stat)
> > + return stat;
> > +
> > + /*
> > + * Sanity check the given block size
> > + */
> > + switch (capbuf.blocklen) {
> > + case 512:
> > + case 1024:
> > + case 2048:
> > + case 4096:
> > + break;
> > + default:
> > + printk(KERN_ERR "ide-cd: weird block size %u\n",
> > + capbuf.blocklen);
> > + printk(KERN_ERR "ide-cd: default to 2kb block size\n");
>
> KERN_WARNING

It's pretty serious, so...

> > + capbuf.blocklen = 2048;
> > + break;
> > }
> >
> > - return stat;
> > + *capacity = 1 + be32_to_cpu(capbuf.lba);
> > + *sectors_per_frame = be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
> > + return 0;
> > }
> >
> > static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag,
> >
>
> I'll test this. Thanks a lot. :)
> However I cannot reproduce the bug. So I cannot tell whether it fixes it.

The patch wont hurt, probably we should just add it just in case.

--
Jens Axboe



\
 
 \ /
  Last update: 2008-06-26 20:49    [W:0.169 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site