* ide-cd detects wrong DVD size
@ 2004-03-11 5:06 Itay Ben-Yaacov
2004-03-11 6:51 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Itay Ben-Yaacov @ 2004-03-11 5:06 UTC (permalink / raw)
To: Jens Axboe, linux-kernel
Hi,
There appears to be a bug in ide-cd.c, which makes it unusable for
playing DVDs -- at some point it just stops reading. This bug does
not exist when using ide-scsi (I heard reports that short DVDs are OK).
The reason seems to be in a wrong detected size:
"blockdev --getsize" gives different results
with ide-cd and with ide-scsi+sr_mod, the latter being the correct
one.
I believe I tracked the problem to "cdrom_read_toc()":
The following (lines 2304-2310) sets the correct capacity (line
numbers are from 2.6.3):
/* Try to get the total cdrom capacity and sector size. */
stat = cdrom_read_capacity(drive, &toc->capacity,
§ors_per_frame,
sense);
if (stat)
toc->capacity = 0x1fffff;
set_capacity(drive->disk, toc->capacity * sectors_per_frame);
But a bit later, on lines 2420-2425, it gets set again, this time to a
wrong value:
/* Now try to get the total cdrom capacity. */
stat = cdrom_get_last_written(cdi, &last_written);
if (!stat && last_written) {
toc->capacity = last_written;
set_capacity(drive->disk, toc->capacity *
sectors_per_frame);
}
Why is this second capacity setting there, and what is it
supposed to do exactly?
Thanks,
Itay
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ide-cd detects wrong DVD size
2004-03-11 5:06 ide-cd detects wrong DVD size Itay Ben-Yaacov
@ 2004-03-11 6:51 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2004-03-11 6:51 UTC (permalink / raw)
To: Itay Ben-Yaacov; +Cc: linux-kernel
On Thu, Mar 11 2004, Itay Ben-Yaacov wrote:
>
> Hi,
>
> There appears to be a bug in ide-cd.c, which makes it unusable for
> playing DVDs -- at some point it just stops reading. This bug does
> not exist when using ide-scsi (I heard reports that short DVDs are OK).
> The reason seems to be in a wrong detected size:
> "blockdev --getsize" gives different results
> with ide-cd and with ide-scsi+sr_mod, the latter being the correct
> one.
>
> I believe I tracked the problem to "cdrom_read_toc()":
> The following (lines 2304-2310) sets the correct capacity (line
> numbers are from 2.6.3):
>
>
>
> /* Try to get the total cdrom capacity and sector size. */
> stat = cdrom_read_capacity(drive, &toc->capacity,
> §ors_per_frame,
> sense);
> if (stat)
> toc->capacity = 0x1fffff;
>
> set_capacity(drive->disk, toc->capacity * sectors_per_frame);
>
>
>
> But a bit later, on lines 2420-2425, it gets set again, this time to a
> wrong value:
>
>
>
> /* Now try to get the total cdrom capacity. */
> stat = cdrom_get_last_written(cdi, &last_written);
> if (!stat && last_written) {
> toc->capacity = last_written;
> set_capacity(drive->disk, toc->capacity *
> sectors_per_frame);
> }
Could have sworn this was already fixed. Change the 2nd occurence to:
if (!toc->capacity || toc->capacity == 0x1fffff) {
stat = cdrom_get_last_written(cdi, &last_written);
if (!stat && last_written) {
toc->capacity = last_written;
set_capacity(drive->disk, toc->capacity *
sectors_per_frame);
}
}
Thanks for tracking this down and reporting.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-11 6:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-11 5:06 ide-cd detects wrong DVD size Itay Ben-Yaacov
2004-03-11 6:51 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox