On Mon, 2008-06-30 at 10:51 -0500, James Bottomley wrote:
OK ... I think I finally found the problem. Our DVD drives obviously
have a slight difference in the way they handle tray close. Mine still
returns tray open for a while after the close operation has been
initiated. To see the behaviour you need it to return not ready; in
process of becoming ready. The zero return from scsi_test_unit_ready()
actually causes sr_media_changed() incorrectly to return zero. But,
before it does, it tries to update the CD information and capacity.
This is where the delay occurs ... as long as the drive reports in
process of becoming ready, sr_cd_check() will wait 2s and retry until it
becomes ready and it can get the CD information.
The problem is I don't think the new behaviour is a regression.
cdparanoia requested O_NONBLOCK ... it's a bit counter to this if we
wait for the drive to become ready. cdparanoia doesn't care that we get
the correct CD parameters on the open since it's using SG_IO to
manipulate the device. So, I think the bug is actually in cdparanoia.
If it requests O_NONBLOCK, it's asking for full status immediately and
is supposed to be able to cope with the returns (including knowing to
retry the NOT_READY ones).
James
--