]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ide-cd capacity fix
authorJens Axboe <axboe@suse.de>
Thu, 25 Mar 2004 22:47:49 +0000 (14:47 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 25 Mar 2004 22:47:49 +0000 (14:47 -0800)
Only allow get_last_written() to override get_capacity(), if it is
bigger.

drivers/ide/ide-cd.c

index 6d9df9d5dea7a2d608761c6a4754361d8d53af2e..465e131d9cde1703c21c7233c41acffe3d4604e7 100644 (file)
@@ -2372,7 +2372,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense)
 
        /* Now try to get the total cdrom capacity. */
        stat = cdrom_get_last_written(cdi, &last_written);
-       if (!stat && last_written) {
+       if (!stat && (last_written > toc->capacity)) {
                toc->capacity = last_written;
                set_capacity(drive->disk, toc->capacity * sectors_per_frame);
        }