Re: [PATCH] Re: Bugs(?) in the cdrom code

Jens Axboe (axboe@image.dk)
Mon, 27 Sep 1999 23:56:36 +0200


On Mon, Sep 27 1999, Eric Lammerts wrote:
> > Possible bug in ide-cd.c ( ver. 4.53 ).
> > The capacity as reported by cdrom_read_capacity() is one block too short for
> > audio CDs on my system. ( Teac CD-532E-B as hdc on PIIX4 , Abit BH-6 board )
>
> > It also check for lba >= capacity ( it should be lba > capacity on my system
> > to work OK with audio CDs )
>
> I checked the ATAPI spec and the test should indeed be lba > capacity.
> On page 72 there's an example of a disk layout from which it is clear
> that the READ_CD-ROM_CAPACITY returns the number of the last sector
> that can be read. So reading with lba == capacity is valid.
>
> --- linux/drivers/block/ide-cd.c.orig Mon Sep 27 23:34:02 1999
> +++ linux/drivers/block/ide-cd.c Mon Sep 27 23:34:18 1999
> @@ -2188,7 +2188,7 @@
> else
> return -EINVAL;
>
> - if (lba < 0 || lba >= toc->capacity)
> + if (lba < 0 || lba > toc->capacity)
> return -EINVAL;
>
> buf = (char *) kmalloc (CDROM_NBLOCKS_BUFFER*CD_FRAMESIZE_RAW,

You are right, I'll add the patch.

-- 
*  Jens Axboe <axboe@image.dk>
*  Linux CD-ROM Maintainer
*  http://www.kernel.dk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/