[SCSI] sr: fix corrupt CD data after media change and delay
commitd1daeabf0da5bfa1943272ce508e2ba785730bf0
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Tue, 10 Jun 2008 15:20:53 +0000 (10 10:20 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Tue, 10 Jun 2008 15:31:23 +0000 (10 10:31 -0500)
treea013f2e673fc8631e86f2f9be433032359412433
parent5e70b7f3c24468bb1635b295945edb48ecd9656a
[SCSI] sr: fix corrupt CD data after media change and delay

Reported-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
If you delay 30s or more before mounting a CD after inserting it then
the kernel has the wrong value for the CD size.

http://marc.info/?t=121276133000001

The problem is in sr_test_unit_ready(): the function eats unit
attentions without adjusting the sdev->changed status.  This means
that when the CD signals changed media via unit attention, we can
ignore it.  Fix by making sr_test_unit_ready() adjust the changed
status.

Tested-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/sr.c