[SCSI] sr: consider the last written sector when determining media size
authorTejun Heo <tj@kernel.org>
Fri, 4 Sep 2009 02:38:02 +0000 (11:38 +0900)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 2 Oct 2009 14:45:46 +0000 (09:45 -0500)
commit5915136d4d3954867cced8a2297bddd16caf36a1
tree4aa0480c498d16db22874c0e6c3cbf7746e23187
parent53203244a4f9988f132ef481867ff47d6bd055b5
[SCSI] sr: consider the last written sector when determining media size

On certain cases, UDF disc doesn't report capacity correctly via
READ_CAPACITY but TOC or trackinfo contains valid information which
can be obtained using cdrom_get_last_written().  ide-cd considers both
values and uses the larger one.  Do the same in sr.  This fixes
bko#9668.

 http://bugzilla.kernel.org/show_bug.cgi?id=9668

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Milan Kocian <milan.kocian@wq.cz>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/sr.c