Commit 05c1339f authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] ide-cd capacity "bug"

From Daniel Pittman <daniel@rimspace.net>

Using the lra (last recorded address) isn't always reliable on some
drives, so use the regular TOC if it returns 0 capacity.
parent c506da41
...@@ -2365,7 +2365,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) ...@@ -2365,7 +2365,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense)
/* Now try to get the total cdrom capacity. */ /* Now try to get the total cdrom capacity. */
stat = cdrom_get_last_written(cdi, (long *) &toc->capacity); stat = cdrom_get_last_written(cdi, (long *) &toc->capacity);
if (stat) if (stat || !toc->capacity)
stat = cdrom_read_capacity(drive, &toc->capacity, sense); stat = cdrom_read_capacity(drive, &toc->capacity, sense);
if (stat) if (stat)
toc->capacity = 0x1fffff; toc->capacity = 0x1fffff;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment