1. 17 10月, 2017 1 次提交
  2. 01 9月, 2017 3 次提交
  3. 30 8月, 2017 1 次提交
    • B
      scsi: Rework handling of scsi_device.vpd_pg8[03] · ccf1e004
      Bart Van Assche 提交于
      Introduce struct scsi_vpd for the VPD page length, data and the RCU head
      that will be used to free the VPD data. Use kfree_rcu() instead of
      kfree() to free VPD data. Move the VPD buffer pointer check inside the
      RCU read lock in the sysfs code. Only annotate pointers that are shared
      across threads with __rcu. Use rcu_dereference() when dereferencing an
      RCU pointer. This patch suppresses about twenty sparse complaints about
      the vpd_pg8[03] pointers. This patch also fixes a race condition, namely
      that updating of the VPD pointers and length variables in struct
      scsi_device was not atomic with reference to the code reading these
      variables. See also "Does the update code tolerate concurrent accesses?"
      in Documentation/RCU/checklist.txt.
      
      Fixes: commit 09e2b0b1 ("scsi: rescan VPD attributes")
      Signed-off-by: NBart Van Assche <bart.vanassche@wdc.com>
      Acked-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NShane Seymour <shane.seymour@hpe.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Cc: Shane Seymour <shane.seymour@hpe.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      ccf1e004
  4. 26 8月, 2017 4 次提交
  5. 25 8月, 2017 2 次提交
  6. 21 6月, 2017 2 次提交
  7. 19 6月, 2017 1 次提交
  8. 13 6月, 2017 9 次提交
  9. 09 6月, 2017 2 次提交
    • C
      blk-mq: switch ->queue_rq return value to blk_status_t · fc17b653
      Christoph Hellwig 提交于
      Use the same values for use for request completion errors as the return
      value from ->queue_rq.  BLK_STS_RESOURCE is special cased to cause
      a requeue, and all the others are completed as-is.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      fc17b653
    • C
      block: introduce new block status code type · 2a842aca
      Christoph Hellwig 提交于
      Currently we use nornal Linux errno values in the block layer, and while
      we accept any error a few have overloaded magic meanings.  This patch
      instead introduces a new  blk_status_t value that holds block layer specific
      status codes and explicitly explains their meaning.  Helpers to convert from
      and to the previous special meanings are provided for now, but I suspect
      we want to get rid of them in the long run - those drivers that have a
      errno input (e.g. networking) usually get errnos that don't know about
      the special block layer overloads, and similarly returning them to userspace
      will usually return somethings that strictly speaking isn't correct
      for file system operations, but that's left as an exercise for later.
      
      For now the set of errors is a very limited set that closely corresponds
      to the previous overloaded errno values, but there is some low hanging
      fruite to improve it.
      
      blk_status_t (ab)uses the sparse __bitwise annotations to allow for sparse
      typechecking, so that we can easily catch places passing the wrong values.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      2a842aca
  10. 02 6月, 2017 1 次提交
  11. 19 5月, 2017 1 次提交
  12. 09 5月, 2017 1 次提交
  13. 02 5月, 2017 1 次提交
  14. 27 4月, 2017 1 次提交
    • B
      scsi: Implement blk_mq_ops.show_rq() · 0eebd005
      Bart Van Assche 提交于
      Show the SCSI CDB for pending SCSI commands in
      /sys/kernel/debug/block/*/mq/*/dispatch and */rq_list. An example
      of how SCSI commands are displayed by this code:
      
      ffff8801703245c0 {.op=READ, .cmd_flags=META PRIO, .rq_flags=DONTPREP IO_STAT STATS, .tag=14, .internal_tag=-1, .cmd=Read(10) 28 00 2a 81 1b 30 00 00 08 00}
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NOmar Sandoval <osandov@fb.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: <linux-scsi@vger.kernel.org>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      0eebd005
  15. 21 4月, 2017 2 次提交
  16. 14 4月, 2017 1 次提交
  17. 08 4月, 2017 1 次提交
    • B
      scsi: Avoid that SCSI queues get stuck · 36e3cf27
      Bart Van Assche 提交于
      If a .queue_rq() function returns BLK_MQ_RQ_QUEUE_BUSY then the block
      driver that implements that function is responsible for rerunning the
      hardware queue once requests can be queued again successfully.
      
      commit 52d7f1b5 ("blk-mq: Avoid that requeueing starts stopped
      queues") removed the blk_mq_stop_hw_queue() call from scsi_queue_rq()
      for the BLK_MQ_RQ_QUEUE_BUSY case. Hence change all calls to functions
      that are intended to rerun a busy queue such that these examine all
      hardware queues instead of only stopped queues.
      
      Since no other functions than scsi_internal_device_block() and
      scsi_internal_device_unblock() should ever stop or restart a SCSI
      queue, change the blk_mq_delay_queue() call into a
      blk_mq_delay_run_hw_queue() call.
      
      Fixes: commit 52d7f1b5 ("blk-mq: Avoid that requeueing starts stopped queues")
      Fixes: commit 7e79dadc ("blk-mq: stop hardware queue in blk_mq_delay_queue()")
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Long Li <longli@microsoft.com>
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      36e3cf27
  18. 07 4月, 2017 2 次提交
  19. 06 4月, 2017 1 次提交
  20. 31 3月, 2017 1 次提交
  21. 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
  22. 24 2月, 2017 1 次提交