1. 02 3月, 2017 1 次提交
    • B
      scsi: mpt3sas: Avoid sleeping in interrupt context · 8893cf6c
      Bart Van Assche 提交于
      Commit 669f0441 ("scsi: srp_transport: Move queuecommand() wait code
      to SCSI core") can make scsi_internal_device_block() sleep.  However,
      the mpt3sas driver can call this function from an interrupt
      handler. Hence add a second argument to scsi_internal_device_block()
      that restores the old behavior of this function for the mpt3sas handler.
      
      The call chain that triggered an "IRQ handler enabled interrupts"
      complaint is as follows:
      
      _base_interrupt()
      -> _base_async_event()
         -> mpt3sas_scsih_event_callback()
            -> _scsih_check_topo_delete_events()
               -> _scsih_block_io_to_children_attached_directly()
                  -> _scsih_block_io_device()
                     -> _scsih_internal_device_block()
                        -> scsi_internal_device_block()
      Reported-by: NOmar Sandoval <osandov@osandov.com>
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Omar Sandoval <osandov@osandov.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sathya Prakash <sathya.prakash@broadcom.com>
      Cc: Chaitra P B <chaitra.basappa@broadcom.com>
      Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      Cc: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Cc: <stable@vger.kernel.org> # v4.10+
      Tested-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      8893cf6c
  2. 24 2月, 2017 2 次提交
  3. 23 2月, 2017 3 次提交
  4. 22 2月, 2017 1 次提交
  5. 20 2月, 2017 1 次提交
    • J
      scsi: don't BUG_ON() empty DMA transfers · fd3fc0b4
      Johannes Thumshirn 提交于
      Don't crash the machine just because of an empty transfer. Use WARN_ON()
      combined with returning an error.
      
      Found by Dmitry Vyukov and syzkaller.
      
      [ Changed to "WARN_ON_ONCE()". Al has a patch that should fix the root
        cause, but a BUG_ON() is not acceptable in any case, and a WARN_ON()
        might still be a cause of excessive log spamming.
      
        NOTE! If this warning ever triggers, we may end up leaking resources,
        since this doesn't bother to try to clean the command up. So this
        WARN_ON_ONCE() triggering does imply real problems. But BUG_ON() is
        much worse.
      
        People really need to stop using BUG_ON() for "this shouldn't ever
        happen". It makes pretty much any bug worse.     - Linus ]
      Signed-off-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Reported-by: NDmitry Vyukov <dvyukov@google.com>
      Cc: James Bottomley <jejb@linux.vnet.ibm.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fd3fc0b4
  6. 01 2月, 2017 2 次提交
  7. 28 1月, 2017 4 次提交
  8. 14 1月, 2017 1 次提交
  9. 21 12月, 2016 1 次提交
  10. 09 12月, 2016 1 次提交
    • C
      block: improve handling of the magic discard payload · f9d03f96
      Christoph Hellwig 提交于
      Instead of allocating a single unused biovec for discard requests, send
      them down without any payload.  Instead we allow the driver to add a
      "special" payload using a biovec embedded into struct request (unioned
      over other fields never used while in the driver), and overloading
      the number of segments for this case.
      
      This has a couple of advantages:
      
       - we don't have to allocate the bio_vec
       - the amount of special casing for discard requests in the block
         layer is significantly reduced
       - using this same scheme for other request types is trivial,
         which will be important for implementing the new WRITE_ZEROES
         op on devices where it actually requires a payload (e.g. SCSI)
       - we can get rid of playing games with the request length, as
         we'll never touch it and completions will work just fine
       - it will allow us to support ranged discard operations in the
         future by merging non-contiguous discard bios into a single
         request
       - last but not least it removes a lot of code
      
      This patch is the common base for my WIP series for ranges discards and to
      remove discard_zeroes_data in favor of always using REQ_OP_WRITE_ZEROES,
      so it would be good to get it in quickly.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f9d03f96
  11. 30 11月, 2016 1 次提交
    • B
      scsi: srp_transport: Move queuecommand() wait code to SCSI core · 669f0441
      Bart Van Assche 提交于
      Additionally, rename srp_wait_for_queuecommand() into
      scsi_wait_for_queuecommand() and add a comment about the queuecommand()
      call from scsi_send_eh_cmnd().
      
      Note: this patch changes scsi_internal_device_block from a function that
      did not sleep into a function that may sleep. This is fine for all
      callers of this function:
      
      * scsi_internal_device_block() is called from the mpt3sas device while
        that driver holds the ioc->dm_cmds.mutex. This means that the mpt3sas
        driver calls this function from thread context.
      * scsi_target_block() is called by __iscsi_block_session() from
        kernel thread context and with IRQs enabled.
      * The SRP transport code also calls scsi_target_block() from kernel
        thread context while sleeping is allowed.
      * The snic driver also calls scsi_target_block() from a context from
        which sleeping is allowed. The scsi_target_block() call namely occurs
        immediately after a scsi_flush_work() call.
      
      [mkp: s/shost/sdev/]
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Cc: James Bottomley <jejb@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Doug Ledford <dledford@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      669f0441
  12. 16 11月, 2016 1 次提交
  13. 09 11月, 2016 1 次提交
  14. 03 11月, 2016 2 次提交
    • B
      blk-mq: Add a kick_requeue_list argument to blk_mq_requeue_request() · 2b053aca
      Bart Van Assche 提交于
      Most blk_mq_requeue_request() and blk_mq_add_to_requeue_list() calls
      are followed by kicking the requeue list. Hence add an argument to
      these two functions that allows to kick the requeue list. This was
      proposed by Christoph Hellwig.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      2b053aca
    • B
      blk-mq: Avoid that requeueing starts stopped queues · 52d7f1b5
      Bart Van Assche 提交于
      Since blk_mq_requeue_work() starts stopped queues and since
      execution of this function can be scheduled after a queue has
      been stopped it is not possible to stop queues without using
      an additional state variable to track whether or not the queue
      has been stopped. Hence modify blk_mq_requeue_work() such that it
      does not start stopped queues. My conclusion after a review of
      the blk_mq_stop_hw_queues() and blk_mq_{delay_,}kick_requeue_list()
      callers is as follows:
      * In the dm driver starting and stopping queues should only happen
        if __dm_suspend() or __dm_resume() is called and not if the
        requeue list is processed.
      * In the SCSI core queue stopping and starting should only be
        performed by the scsi_internal_device_block() and
        scsi_internal_device_unblock() functions but not by any other
        function. Although the blk_mq_stop_hw_queue() call in
        scsi_queue_rq() may help to reduce CPU load if a LLD queue is
        full, figuring out whether or not a queue should be restarted
        when requeueing a command would require to introduce additional
        locking in scsi_mq_requeue_cmd() to avoid a race with
        scsi_internal_device_block(). Avoid this complexity by removing
        the blk_mq_stop_hw_queue() call from scsi_queue_rq().
      * In the NVMe core only the functions that call
        blk_mq_start_stopped_hw_queues() explicitly should start stopped
        queues.
      * A blk_mq_start_stopped_hwqueues() call must be added in the
        xen-blkfront driver in its blkif_recover() function.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Roger Pau Monné <roger.pau@citrix.com>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: James Bottomley <jejb@linux.vnet.ibm.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      52d7f1b5
  15. 28 10月, 2016 1 次提交
  16. 15 9月, 2016 1 次提交
  17. 23 5月, 2016 1 次提交
  18. 11 5月, 2016 1 次提交
  19. 16 4月, 2016 5 次提交
  20. 27 2月, 2016 1 次提交
  21. 24 2月, 2016 1 次提交
  22. 03 12月, 2015 2 次提交
  23. 07 11月, 2015 1 次提交
  24. 01 10月, 2015 1 次提交
  25. 29 8月, 2015 1 次提交
  26. 26 8月, 2015 1 次提交
  27. 31 7月, 2015 1 次提交