1. 18 7月, 2014 10 次提交
  2. 04 7月, 2014 1 次提交
  3. 01 7月, 2014 1 次提交
  4. 12 6月, 2014 1 次提交
  5. 02 6月, 2014 1 次提交
  6. 20 5月, 2014 1 次提交
  7. 19 5月, 2014 1 次提交
  8. 10 4月, 2014 1 次提交
  9. 27 3月, 2014 3 次提交
  10. 25 3月, 2014 1 次提交
  11. 19 3月, 2014 1 次提交
    • D
      libata, libsas: kill pm_result and related cleanup · bc6e7c4b
      Dan Williams 提交于
      Tejun says:
        "At least for libata, worrying about suspend/resume failures don't make
         whole lot of sense.  If suspend failed, just proceed with suspend.  If
         the device can't be woken up afterwards, that's that.  There isn't
         anything we could have done differently anyway.  The same for resume, if
         spinup fails, the device is dud and the following commands will invoke
         EH actions and will eventually fail.  Again, there really isn't any
         *choice* to make.  Just making sure the errors are handled gracefully
         (ie. don't crash) and the following commands are handled correctly
         should be enough."
      
      The only libata user that actually cares about the result from a suspend
      operation is libsas.  However, it only cares about whether queuing a new
      operation collides with an in-flight one.  All libsas does with the
      error is retry, but we can just let libata wait for the previous
      operation before continuing.
      
      Other cleanups include:
      1/ Unifying all ata port pm operations on an ata_port_pm_ prefix
      2/ Marking all ata port pm helper routines as returning void, only
         ata_port_pm_ entry points need to fake a 0 return value.
      3/ Killing ata_port_{suspend|resume}_common() in favor of calling
         ata_port_request_pm() directly
      4/ Killing the wrappers that just do a to_ata_port() conversion
      5/ Clearly marking the entry points that do async operations with an
        _async suffix.
      
      Reference: http://marc.info/?l=linux-scsi&m=138995409532286&w=2
      
      Cc: Phillip Susi <psusi@ubuntu.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Suggested-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NTodd Brandt <todd.e.brandt@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      bc6e7c4b
  12. 18 3月, 2014 1 次提交
    • S
      SCSI/libiscsi: Add check_protection callback for transports · 55e51eda
      Sagi Grimberg 提交于
      iSCSI needs to be at least aware that a task involves protection
      information.  In case it does, after the transaction completed libiscsi
      will ask the transport to check the protection status of the
      transaction.
      
      Unlike transport errors, DIF errors should not prevent successful
      completion of the transaction from the transport point of view, but
      should be escelated to scsi mid-layer when constructing the scsi
      result and sense data.
      
      check_protection routine will return the ascq corresponding to the DIF
      error that occured (or 0 if no error happened).
      
      return ascq:
      - 0x1: GUARD_CHECK_FAILED
      - 0x2: APPTAG_CHECK_FAILED
      - 0x3: REFTAG_CHECK_FAILED
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NAlex Tabachnik <alext@mellanox.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      55e51eda
  13. 16 3月, 2014 5 次提交
    • C
      [SCSI] do not manipulate device reference counts in scsi_get/put_command · 04796336
      Christoph Hellwig 提交于
      Many callers won't need this and we can optimize them away.  In addition
      the handling in the __-prefixed variants was inconsistant to start with.
      
      Based on an earlier patch from Bart Van Assche.
      
      [jejb: fix kerneldoc probelm picked up by Fengguang Wu]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      04796336
    • S
      [SCSI] libiscsi: Reduce locking contention in fast path · 659743b0
      Shlomo Pongratz 提交于
      Replace the session lock with two locks, a forward lock and
      a backwards lock named frwd_lock and back_lock respectively.
      
      The forward lock protects resources that change while sending a
      request to the target, such as cmdsn, queued_cmdsn, and allocating
      task from the commands' pool with kfifo_out.
      
      The backward lock protects resources that change while processing
      a response or in error path, such as cmdsn_exp, cmdsn_max, and
      returning tasks to the commands' pool with kfifo_in.
      
      Under a steady state fast-path situation, that is when one
      or more processes/threads submit IO to an iscsi device and
      a single kernel upcall (e.g softirq) is dealing with processing
      of responses without errors, this patch eliminates the contention
      between the queuecommand()/request response/scsi_done() flows
      associated with iscsi sessions.
      
      Between the forward and the backward locks exists a strict locking
      hierarchy. The mutual exclusion zone protected by the forward lock can
      enclose the mutual exclusion zone protected by the backward lock but not
      vice versa.
      
      For example, in iscsi_conn_teardown or in iscsi_xmit_data when there is
      a failure and __iscsi_put_task is called, the backward lock is taken while
      the forward lock is still taken. On the other hand, if in the RX path a nop
      is to be sent, for example in iscsi_handle_reject or __iscsi_complete_pdu
      than the forward lock is released and the backward lock is taken for the
      duration of iscsi_send_nopout, later the backward lock is released and the
      forward lock is retaken.
      
      libiscsi_tcp uses two kernel fifos the r2t pool and the r2t queue.
      
      The insertion and deletion from these queues didn't corespond to the
      assumption taken by the new forward/backwards session locking paradigm.
      
      That is, in iscsi_tcp_clenup_task which belongs to the RX (backwards)
      path, r2t is taken out from r2t queue and inserted to the r2t pool.
      In iscsi_tcp_get_curr_r2t which belong to the TX (forward) path, r2t
      is also inserted to the r2t pool and another r2t is pulled from r2t
      queue.
      
      Only in iscsi_tcp_r2t_rsp which is called in the RX path but can requeue
      to the TX path, r2t is taken from the r2t pool and inserted to the r2t
      queue.
      
      In order to cope with this situation, two spin locks were added,
      pool2queue and queue2pool. The former protects extracting from the
      r2t pool and inserting to the r2t queue, and the later protects the
      extracing from the r2t queue and inserting to the r2t pool.
      Signed-off-by: NShlomo Pongratz <shlomop@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      [minor fix up to apply cleanly and compile fix]
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      659743b0
    • J
      [SCSI] fix our current target reap infrastructure · e63ed0d7
      James Bottomley 提交于
      This patch eliminates the reap_ref and replaces it with a proper kref.
      On last put of this kref, the target is removed from visibility in
      sysfs.  The final call to scsi_target_reap() for the device is done from
      __scsi_remove_device() and only if the device was made visible.  This
      ensures that the target disappears as soon as the last device is gone
      rather than waiting until final release of the device (which is often
      too long).
      Reviewed-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org # delay backport by 2 months for field testing
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      e63ed0d7
    • D
      [SCSI] libsas: introduce scmd_dbg() to quiet false positive "timeout" messages · 3af74a3c
      Dan Williams 提交于
      libsas sometimes short circuits timeouts to force commands into error
      recovery.  It is misleading to log that the command timed-out in
      sas_scsi_timed_out() when in fact it was just queued for error handling.
      It's also redundant in the case of a true timeout as libata eh will
      detect and report timeouts via it's AC_ERR_TIMEOUT facility.
      
      Given that some environments consider "timeout" errors to be indicative
      of impending device failure demote the sas_scsi_timed_out() timeout
      message to be disabled by default.  This parallels ata_scsi_timed_out().
      
      [jejb: checkpatch fix]
      Reported-by: NXun Ni <xun.ni@intel.com>
      Tested-by: NNelson Cheng <nelson.cheng@intel.com>
      Acked-by: NLukasz Dorau <lukasz.dorau@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      3af74a3c
    • C
  14. 23 1月, 2014 1 次提交
    • B
      ore: Fix wrong math in allocation of per device BIO · aad560b7
      Boaz Harrosh 提交于
      At IO preparation we calculate the max pages at each device and
      allocate a BIO per device of that size. The calculation was wrong
      on some unaligned corner cases offset/length combination and would
      make prepare return with -ENOMEM. This would be bad for pnfs-objects
      that would in that case IO through MDS. And fatal for exofs were it
      would fail writes with EIO.
      
      Fix it by doing the proper math, that will work in all cases. (I
      ran a test with all possible offset/length combinations this time
      round).
      
      Also when reading we do not need to allocate for the parity units
      since we jump over them.
      
      Also lower the max_io_length to take into account the parity pages
      so not to allocate BIOs bigger than PAGE_SIZE
      
      CC: Stable Kernel <stable@vger.kernel.org>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      aad560b7
  15. 22 1月, 2014 2 次提交
    • B
      scsi_transport_srp: Fix kernel-doc warnings · 0c7f8218
      Bart Van Assche 提交于
      The following command has been used to verify that the kernel-doc
      tool no longer complains about undocumented fields:
      
          scripts/kernel-doc -html drivers/scsi/scsi_transport_srp.c \
            include/scsi/scsi_transport_srp.h >srp-transport-doc.html
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Acked-by: NSebastian Riemer <sebastian.riemer@profitbricks.com>
      Acked-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      0c7f8218
    • B
      scsi_transport_srp: Fix a race condition · 93079162
      Bart Van Assche 提交于
      The rport timers must be stopped before the SRP initiator destroys the
      resources associated with the SCSI host. This is necessary because
      otherwise the callback functions invoked from the SRP transport layer
      could trigger a use-after-free. Stopping the rport timers before
      invoking scsi_remove_host() can trigger long delays in the SCSI error
      handler if a transport layer failure occurs while scsi_remove_host()
      is in progress. Hence move the code for stopping the rport timers from
      srp_rport_release() into a new function and invoke that function after
      scsi_remove_host() has finished. This patch fixes the following
      sporadic kernel crash:
      
           kernel BUG at include/asm-generic/dma-mapping-common.h:64!
           invalid opcode: 0000 [#1] SMP
           RIP: 0010:[<ffffffffa03b20b1>]  [<ffffffffa03b20b1>] srp_unmap_data+0x121/0x130 [ib_srp]
           Call Trace:
           [<ffffffffa03b20fc>] srp_free_req+0x3c/0x80 [ib_srp]
           [<ffffffffa03b2188>] srp_finish_req+0x48/0x70 [ib_srp]
           [<ffffffffa03b21fb>] srp_terminate_io+0x4b/0x60 [ib_srp]
           [<ffffffffa03a6fb5>] __rport_fail_io_fast+0x75/0x80 [scsi_transport_srp]
           [<ffffffffa03a7438>] rport_fast_io_fail_timedout+0x88/0xc0 [scsi_transport_srp]
           [<ffffffff8108b370>] worker_thread+0x170/0x2a0
           [<ffffffff81090876>] kthread+0x96/0xa0
           [<ffffffff8100c0ca>] child_rip+0xa/0x20
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      93079162
  16. 10 1月, 2014 1 次提交
  17. 20 12月, 2013 3 次提交
  18. 19 12月, 2013 2 次提交
    • H
      [SCSI] improved eh timeout handler · e494f6a7
      Hannes Reinecke 提交于
      When a command runs into a timeout we need to send an 'ABORT TASK'
      TMF. This is typically done by the 'eh_abort_handler' LLDD callback.
      
      Conceptually, however, this function is a normal SCSI command, so
      there is no need to enter the error handler.
      
      This patch implements a new scsi_abort_command() function which
      invokes an asynchronous function scsi_eh_abort_handler() to
      abort the commands via the usual 'eh_abort_handler'.
      
      If abort succeeds the command is either retried or terminated,
      depending on the number of allowed retries. However, 'eh_eflags'
      records the abort, so if the retry would fail again the
      command is pushed onto the error handler without trying to
      abort it (again); it'll be cleared up from SCSI EH.
      
      [hare: smatch detected stray switch fixed]
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      e494f6a7
    • J
      [SCSI] Fix erratic device offline during EH · 2451079b
      James Bottomley 提交于
      Commit 18a4d0a2
      (Handle disk devices which can not process medium access commands)
      was introduced to offline any device which cannot process medium
      access commands.
      However, commit 3eef6257
      (Reduce error recovery time by reducing use of TURs) reduced
      the number of TURs by sending it only on the first failing
      command, which might or might not be a medium access command.
      So in combination this results in an erratic device offlining
      during EH; if the command where the TUR was sent upon happens
      to be a medium access command the device will be set offline,
      if not everything proceeds as normal.
      
      This patch moves the check to the final test, eliminating
      this problem.
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      2451079b
  19. 17 12月, 2013 2 次提交
  20. 29 11月, 2013 1 次提交
    • M
      [SCSI] Disable WRITE SAME for RAID and virtual host adapter drivers · 54b2b50c
      Martin K. Petersen 提交于
      Some host adapters do not pass commands through to the target disk
      directly. Instead they provide an emulated target which may or may not
      accurately report its capabilities. In some cases the physical device
      characteristics are reported even when the host adapter is processing
      commands on the device's behalf. This can lead to adapter firmware hangs
      or excessive I/O errors.
      
      This patch disables WRITE SAME for devices connected to host adapters
      that provide an emulated target. Driver writers can disable WRITE SAME
      by setting the no_write_same flag in the host adapter template.
      
      [jejb: fix up rejections due to eh_deadline patch]
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      54b2b50c