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

Eric Lammerts (eric@scintilla.utwente.nl)
Mon, 27 Sep 1999 23:44:31 +0200 (CEST)


On Mon, 27 Sep 1999, DAVID BALAZIC 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,

Eric

-- 
Eric Lammerts <eric@scintilla.utwente.nl>

- 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/