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

Pascal Schmidt
2003-11-11T23:47:05Z

On Tue, 11 Nov 2003, Linus Torvalds wrote:

> Ok, that's just strange. You can't even _read_ from the raw device, but
> the mount works ok?

Exactly.

> And you got no IO errors anywhere? I don't see why the write would fail
> silently.

Nope, no errors anywhere.

> I wonder whether the disk capacity is set to zero. See
> drivers/ide/ide-cd.c, and in particular the
>
> /* Now try to get the total cdrom capacity. */
> stat = cdrom_get_last_written(cdi, (long *) &toc->capacity);
> if (stat || !toc->capacity)
> stat = cdrom_read_capacity(drive, &toc->capacity, sense);
> if (stat)
> toc->capacity = 0x1fffff;
>
> and see what that says.. I really think you should start sprinkling
> printk's around the thing to determine what goes on..

Did that. The code you quote from cdrom_read_toc is never even reached,
the first cdrom_read_tocentry in there just errors out because there
is no toc to read on an MO disk. This leaves the capacity64 member in
the associated ide_drive_t at 0 and also the capacity member in the
corresponding gendisk structure.

On mount, idecd_revalidate_disk gets called and also tries a
cdrom_read_toc, once again leaving the capacity at 0. Nevertheless,
the mount succeeds.

So, reading via dd seems to respect capacity, that explains the "no
space left on device" on writing and the read resulting in zero data
without error. Mounting doesn't even seem to look at the capacity.

My guess would be that an MO drive needs a different way to find out
the capacity than a CD-ROM. After all, when using ide-scsi, it is the
sd driver and not sr that handles the drive. The rest of the problems
could be due to the wrong capacity information?

--
Ciao,
Pascal