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

From: Andries Brouwer (aeb@veritas.com)
Date: Mon Aug 14 2000 - 17:43:11 EST


On Mon, Aug 14, 2000 at 02:50:26PM -0700, Adam J. Richter wrote:
>
> linux-2.4.0-test2 through linux-2.4.0-test7pre3 appear to
> return garbage for the capacity of a DVD in an IDE (as opposed to SCSI)
> drive.
>
> The problem has been exposed by a change to cdrom_read_toc
> in drivers/ide/ide-cd.c. Here is an excerpt from cdrom_read_toc:
>
> /* Now try to get the total cdrom capacity. */
> minor = (drive->select.b.unit) << PARTN_BITS;
> dev = MKDEV(HWIF(drive)->major, minor);
> stat = cdrom_get_last_written(dev, (long *)&toc->capacity);
> if (stat)
> stat = cdrom_read_capacity(drive, &toc->capacity, sense);
> if (stat)
> toc->capacity = 0x1fffff;
>
>
> Prior to linux-2.4.0-test2, the call to cdrom_get_last_written
> had been commented out.

Ah - I may have been responsible for removing the `#if 0',
see the linux-kernel post of 9 Jun 2000 with subject `[PATCH] cdrom stuff'.
In my patch I had

+ if (!CDROM_CAN(CDC_CD_R | CDC_CD_RW))
                goto use_toc;

but the current kernel code has (in cdrom_get_last_written())

        if (!CDROM_CAN(CDC_CD_R | CDC_CD_RW | CDC_DVD_R | CDC_DVD_RAM))
                goto use_toc;

Do things improve if you go back to my version?

Andries

-
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:34 EST