1. 06 Nov, 2008 6 commits
    • Tejun Heo's avatar
      block: fix __blkdev_get() for removable devices · 89f97496
      Tejun Heo authored
      Commit 0762b8bd moved disk_get_part()
      in front of recursive get on the whole disk, which caused removable
      devices to try disk_get_part() before rescanning after a new media is
      inserted, which might fail legit open attempts or give the old
      partition.
      
      This patch fixes the problem by moving disk_get_part() after
      __blkdev_get() on the whole disk.
      
      This problem was spotted by Borislav Petkov.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Tested-by: default avatarBorislav Petkov <petkovbb@gmail.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      89f97496
    • Suresh Siddha's avatar
      generic-ipi: fix the smp_mb() placement · 561920a0
      Suresh Siddha authored
      smp_mb() is needed (to make the memory operations visible globally) before
      sending the ipi on the sender and the receiver (on Alpha atleast) needs
      smp_read_barrier_depends() in the handler before reading the call_single_queue
      list in a lock-free fashion.
      
      On x86, x2apic mode register accesses for sending IPI's don't have serializing
      semantics. So the need for smp_mb() before sending the IPI becomes more
      critical in x2apic mode.
      
      Remove the unnecessary smp_mb() in csd_flag_wait(), as the presence of that
      smp_mb() doesn't mean anything on the sender, when the ipi receiver is not
      doing any thing special (like memory fence) after clearing the CSD_FLAG_WAIT.
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      561920a0
    • Mike Anderson's avatar
      blk: move blk_delete_timer call in end_that_request_last · e78042e5
      Mike Anderson authored
      Move the calling  blk_delete_timer to later in end_that_request_last to
      address an issue where blkdev_dequeue_request may have add a timer for the
      request.
      Signed-off-by: default avatarMike Anderson <andmike@linux.vnet.ibm.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      e78042e5
    • Tejun Heo's avatar
      block: add timer on blkdev_dequeue_request() not elv_next_request() · 2920ebbd
      Tejun Heo authored
      Block queue supports two usage models - one where block driver peeks
      at the front of queue using elv_next_request(), processes it and
      finishes it and the other where block driver peeks at the front of
      queue, dequeue the request using blkdev_dequeue_request() and finishes
      it.  The latter is more flexible as it allows the driver to process
      multiple commands concurrently.
      
      These two inconsistent usage models affect the block layer
      implementation confusing.  For some, elv_next_request() is considered
      the issue point while others consider blkdev_dequeue_request() the
      issue point.
      
      Till now the inconsistency mostly affect only accounting, so it didn't
      really break anything seriously; however, with block layer timeout,
      this inconsistency hits hard.  Block layer considers
      elv_next_request() the issue point and adds timer but SCSI layer
      thinks it was just peeking and when the request can't process the
      command right away, it's just left there without further processing.
      This makes the request dangling on the timer list and, when the timer
      goes off, the request which the SCSI layer and below think is still on
      the block queue ends up in the EH queue, causing various problems - EH
      hang (failed count goes over busy count and EH never wakes up),
      WARN_ON() and oopses as low level driver trying to handle the unknown
      command, etc. depending on the timing.
      
      As SCSI midlayer is the only user of block layer timer at the moment,
      moving blk_add_timer() to elv_dequeue_request() fixes the problem;
      however, this two usage models definitely need to be cleaned up in the
      future.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      2920ebbd
    • Jeremy Fitzhardinge's avatar
      bio: define __BIOVEC_PHYS_MERGEABLE · f92131c3
      Jeremy Fitzhardinge authored
      Define __BIOVEC_PHYS_MERGEABLE as the default implementation of
      BIOVEC_PHYS_MERGEABLE, so that its available for reuse within an
      arch-specific definition of BIOVEC_PHYS_MERGEABLE.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      f92131c3
    • FUJITA Tomonori's avatar
  2. 04 Nov, 2008 15 commits
  3. 03 Nov, 2008 19 commits