Re: 2.9test9-mm1 and DAO ATAPI cd-burning corrupt

Jens Axboe
2003-11-13T15:28:02Z

On Thu, Nov 13 2003, Linus Torvalds wrote:
>
> On Thu, 13 Nov 2003, Jens Axboe wrote:
>
> > On Thu, Nov 13 2003, Pascal Schmidt wrote:
> > >
> > > My patch from yesterday should handle that situation.
> > > cdrom_get_last_written is allowed to override the capacity from
> > > cdrom_read_capacity.
> >
> > Yep, that is fine.
>
> Well, there is a good argument for not bothering with the
> "cdrom_get_last_written" at all: the SCSI layer never does anything like
> that as far as I can see, so arguably everybody who ever used ide-scsi
> would only ever have seen the READ_CAPACITY command be used. And nobody
> ever complained about bad capacitites as far as I can remember..
>
> But I might have missed something in the SCSI driver. But I actually see a
>
> if (cdrom_get_last_written(..)
>
> in sr.c, and it's been #if 0'ed out since before the Bitkeeper tree
> started. And that code definitely does the READ_CAPACITY first.
>
> The "sd.c" code (which is what a MO device would use) obviously doesn't do
> cdrom_get_last_written either - it just does a READ_CAPACITY. (Well, it
> does a READ_CAPACITY_16 if it hits a really big disk, but that only hits
> if the disk has more than 4G sectors, so we can ignore it for CD-ROM's for
> a while.
>
> So I'd argue for just dropping the cdrom_get_last_written() call entirely.

Your argument isn't very good, imo. I was the one that added the
cdrom_get_last_written() calls, because with the pktcdvd written media
reading the toc or using READ_CAPACITY just didn't work.

For MO drives, DVD-RAM, and that sort of thing there's no argument -
read capacity is the way to go. For CDROMs it's not so clear.

--
Jens Axboe