lkml.org 
[lkml]   [2004]   [Mar]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 11 Mar 2004 00:06:00 -0500
Subjectide-cd detects wrong DVD size
FromItay Ben-Yaacov <>
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,
&sectors_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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:01    [from the cache]
©2003-2008