Re: DVD capacity bug for IDE CD's in linux-2.4.0-test6

From: Adam J. Richter (adam@yggdrasil.com)
Date: Mon Aug 14 2000 - 21:33:39 EST


Jens Axboe <axboe@suse.de> writes:

>On Mon, Aug 14 2000, Adam J. Richter wrote:
>> >That's a bit rough, though. How about something like
>> >
>> > if (!CDROM_STATE_FLAGS(drive)->toc_valid) {
>> > int ret = cdrom_read_toc(drive, NULL);
>> > if (ret)
>> > return ret;
>> > }
>> >
>> >so the toc entry is read and the toc itself refreshed. Does that work
>> >as well (note untested, just typed it above)?
>>
>> But cdrom_read_toc is the routine that called this in
>> the first place. That would create an infinite loop. Here, again,
>> is the call graph from my original email:

>Ah duh, it's way too late here. Your fix should suffice for now, I'll
>split cdrom_read_toc and the toc handling into something a bit more
>organized (you probably noted the mess).

        Great. Do you want me to send the following patch to Linus
or do one of you guys want to handle it?

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

----------------------CUT HERE-------------------------------------------

--- linux-2.4.0-test7-pre4/drivers/ide/ide-cd.c Tue Jul 18 21:40:47 2000
+++ linux/drivers/ide//ide-cd.c Mon Aug 14 14:59:18 2000
@@ -1840,14 +1840,17 @@
 static int cdrom_get_toc_entry(ide_drive_t *drive, int track,
                                 struct atapi_toc_entry **ent)
 {
         struct cdrom_info *info = drive->driver_data;
         struct atapi_toc *toc = info->toc;
         int ntracks;
 
+ if (!CDROM_STATE_FLAGS(drive)->toc_valid)
+ return -EINVAL;
+
         /* Check validity of requested track number. */
         ntracks = toc->hdr.last_track - toc->hdr.first_track + 1;
         if (toc->hdr.first_track == CDROM_LEADOUT) ntracks = 0;
         if (track == CDROM_LEADOUT)
                 *ent = &toc->ent[ntracks];
         else if (track < toc->hdr.first_track ||
                  track > toc->hdr.last_track)

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



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:35 EST