1. 29 Apr, 2011 1 commit
    • Tejun Heo's avatar
      cdrom: always check_disk_change() on open · bf2253a6
      Tejun Heo authored
      cdrom_open() called check_disk_change() after the rest of open path
      succeeded which leads to the following bizarre behavior.
      
      * After media change, if the device opened without O_NONBLOCK,
        open_for_data() naturally fails with -ENOMEDIA and
        check_disk_change() is never called.  The media is known to be gone
        and the open failure makes it obvious to the userland but device
        invalidation never happens.
      
      * But if the device is opened with O_NONBLOCK, all the checks are
        bypassed and cdrom_open() doesn't notice that the media is not there
        and check_disk_change() is called and invalidation happens.
      
      There's nothing to be gained by avoiding calling check_disk_change()
      on open failure.  Common cases end up calling check_disk_change()
      anyway.  All we get is inconsistent behavior.
      
      Fix it by moving check_disk_change() invocation to the top of
      cdrom_open() so that it always gets called regardless of how the rest
      of open proceeds.
      
      Stable: 2.6.38
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarAmit Shah <amit.shah@redhat.com>
      Tested-by: default avatarAmit Shah <amit.shah@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      bf2253a6
  2. 21 Apr, 2011 26 commits
  3. 20 Apr, 2011 11 commits
  4. 19 Apr, 2011 2 commits