1. 27 8月, 2015 2 次提交
  2. 03 8月, 2015 2 次提交
  3. 31 7月, 2015 1 次提交
  4. 02 6月, 2015 1 次提交
    • B
      target: Minimize SCSI header #include directives · ba929992
      Bart Van Assche 提交于
      Only include SCSI initiator header files in target code that needs
      these header files, namely the SCSI pass-through code and the tcm_loop
      driver. Change SCSI_SENSE_BUFFERSIZE into TRANSPORT_SENSE_BUFFER in
      target code because the former is intended for initiator code and the
      latter for target code. With this patch the only initiator include
      directives in target code that remain are as follows:
      
      $ git grep -nHE 'include .scsi/(scsi.h|scsi_host.h|scsi_device.h|scsi_cmnd.h)' drivers/target drivers/infiniband/ulp/{isert,srpt} drivers/usb/gadget/legacy/tcm_*.[ch] drivers/{vhost,xen} include/{target,trace/events/target.h}
      drivers/target/loopback/tcm_loop.c:29:#include <scsi/scsi.h>
      drivers/target/loopback/tcm_loop.c:31:#include <scsi/scsi_host.h>
      drivers/target/loopback/tcm_loop.c:32:#include <scsi/scsi_device.h>
      drivers/target/loopback/tcm_loop.c:33:#include <scsi/scsi_cmnd.h>
      drivers/target/target_core_pscsi.c:39:#include <scsi/scsi_device.h>
      drivers/target/target_core_pscsi.c:40:#include <scsi/scsi_host.h>
      drivers/xen/xen-scsiback.c:52:#include <scsi/scsi_host.h> /* SG_ALL */
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      ba929992
  5. 31 5月, 2015 4 次提交
  6. 29 5月, 2015 1 次提交
  7. 20 5月, 2015 1 次提交
  8. 15 4月, 2015 1 次提交
    • C
      target: simplify the target template registration API · 9ac8928e
      Christoph Hellwig 提交于
      Instead of calling target_fabric_configfs_init() +
      target_fabric_configfs_register() / target_fabric_configfs_deregister()
      target_fabric_configfs_free() from every target driver, rewrite the API
      so that we have simple register/unregister functions that operate on
      a const operations vector.
      
      This patch also fixes a memory leak in several target drivers. Several
      target drivers namely called target_fabric_configfs_deregister()
      without calling target_fabric_configfs_free().
      
      A large part of this patch is based on earlier changes from
      Bart Van Assche <bart.vanassche@sandisk.com>.
      
      (v2: Add a new TF_CIT_SETUP_DRV macro so that the core configfs code
      can declare attributes as either core only or for drivers)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9ac8928e
  9. 11 4月, 2015 1 次提交
    • M
      iscsi target: fix oops when adding reject pdu · b815fc12
      Mike Christie 提交于
      This fixes a oops due to a double list add when adding a reject PDU for
      iscsit_allocate_iovecs allocation failures. The cmd has already been
      added to the conn_cmd_list in iscsit_setup_scsi_cmd, so this has us call
      iscsit_reject_cmd.
      
      Note that for ERL0 the reject PDU is not actually sent, so this patch
      is not completely tested. Just verified we do not oops. The problem is the
      add reject functions return -1 which is returned all the way up to
      iscsi_target_rx_thread which for ERL0 will drop the connection.
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Cc: <stable@vger.kernel.org> # v3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b815fc12
  10. 08 4月, 2015 1 次提交
  11. 27 3月, 2015 2 次提交
  12. 21 3月, 2015 1 次提交
  13. 20 3月, 2015 1 次提交
    • N
      iscsi-target: Avoid early conn_logout_comp for iser connections · f068fbc8
      Nicholas Bellinger 提交于
      This patch fixes a iser specific logout bug where early complete()
      of conn->conn_logout_comp in iscsit_close_connection() was causing
      isert_wait4logout() to complete too soon, triggering a use after
      free NULL pointer dereference of iscsi_conn memory.
      
      The complete() was originally added for traditional iscsi-target
      when a ISCSI_LOGOUT_OP failed in iscsi_target_rx_opcode(), but given
      iser-target does not wait in logout failure, this special case needs
      to be avoided.
      Reported-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Slava Shwartsman <valyushash@gmail.com>
      Cc: <stable@vger.kernel.org> # v3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f068fbc8
  14. 13 2月, 2015 1 次提交
  15. 05 2月, 2015 2 次提交
  16. 31 1月, 2015 1 次提交
  17. 10 1月, 2015 1 次提交
  18. 04 12月, 2014 1 次提交
  19. 02 12月, 2014 1 次提交
  20. 29 10月, 2014 1 次提交
  21. 18 9月, 2014 2 次提交
  22. 28 6月, 2014 1 次提交
  23. 12 6月, 2014 1 次提交
  24. 10 6月, 2014 1 次提交
    • N
      iscsi-target: Fix ABORT_TASK + connection reset iscsi_queue_req memory leak · bbc05048
      Nicholas Bellinger 提交于
      This patch fixes a iscsi_queue_req memory leak when ABORT_TASK response
      has been queued by TFO->queue_tm_rsp() -> lio_queue_tm_rsp() after a
      long standing I/O completes, but the connection has already reset and
      waiting for cleanup to complete in iscsit_release_commands_from_conn()
      -> transport_generic_free_cmd() -> transport_wait_for_tasks() code.
      
      It moves iscsit_free_queue_reqs_for_conn() after the per-connection command
      list has been released, so that the associated se_cmd tag can be completed +
      released by target-core before freeing any remaining iscsi_queue_req memory
      for the connection generated by lio_queue_tm_rsp().
      
      Cc: Thomas Glanzmann <thomas@glanzmann.de>
      Cc: Charalampos Pournaris <charpour@gmail.com>
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bbc05048
  25. 07 6月, 2014 1 次提交
  26. 04 6月, 2014 1 次提交
    • N
      iser-target: Fix multi network portal shutdown regression · 2363d196
      Nicholas Bellinger 提交于
      This patch fixes a iser-target specific regression introduced in
      v3.15-rc6 with:
      
      commit 14f4b54f
      Author: Sagi Grimberg <sagig@mellanox.com>
      Date:   Tue Apr 29 13:13:47 2014 +0300
      
          Target/iscsi,iser: Avoid accepting transport connections during stop stage
      
      where the change to set iscsi_np->enabled = false within
      iscsit_clear_tpg_np_login_thread() meant that a iscsi_np with
      two iscsi_tpg_np exports would have it's parent iscsi_np set
      to a disabled state, even if other iscsi_tpg_np exports still
      existed.
      
      This patch changes iscsit_clear_tpg_np_login_thread() to only
      set iscsi_np->enabled = false when shutdown = true, and also
      changes iscsit_del_np() to set iscsi_np->enabled = true when
      iscsi_np->np_exports is non zero.
      
      Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
      Cc: stable@vger.kernel.org # 3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      2363d196
  27. 16 5月, 2014 1 次提交
    • N
      iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out · 7cbfcc95
      Nicholas Bellinger 提交于
      This patch changes an incorrect use of BUG_ON to instead generate a
      REJECT + PROTOCOL_ERROR in iscsit_process_nop_out() code.  This case
      can occur with traditional TCP where a flood of zeros in the data
      stream can reach this block for what is presumed to be a NOP-OUT with
      a solicited reply, but without a valid iscsi_cmd pointer.
      
      This incorrect BUG_ON was introduced during the v3.11-rc timeframe
      with the following commit:
      
      commit 778de368
      Author: Nicholas Bellinger <nab@linux-iscsi.org>
      Date:   Fri Jun 14 16:07:47 2013 -0700
      
          iscsi/isert-target: Refactor ISCSI_OP_NOOP RX handling
      Reported-by: NArshad Hussain <arshad.hussain@calsoftinc.com>
      Cc: stable@vger.kernel.org # 3.11+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7cbfcc95
  28. 07 4月, 2014 4 次提交
    • N
      target: Pass in transport supported PI at session initialization · e70beee7
      Nicholas Bellinger 提交于
      In order to support local WRITE_INSERT + READ_STRIP operations for
      non PI enabled fabrics, the fabric driver needs to be able signal
      what protection offload operations are supported.
      
      This is done at session initialization time so the modes can be
      signaled by individual se_wwn + se_portal_group endpoints, as well
      as optionally across different transports on the same endpoint.
      
      For iser-target, set TARGET_PROT_ALL if the underlying ib_device
      has already signaled PI offload support, and allow this to be
      exposed via a new iscsit_transport->iscsit_get_sup_prot_ops()
      callback.
      
      For loopback, set TARGET_PROT_ALL to signal SCSI initiator mode
      operation.
      
      For all other drivers, set TARGET_PROT_NORMAL to disable fabric
      level PI.
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e70beee7
    • N
      iscsi-target: Fix ERL=2 ASYNC_EVENT connection pointer bug · d444edc6
      Nicholas Bellinger 提交于
      This patch fixes a long-standing bug in iscsit_build_conn_drop_async_message()
      where during ERL=2 connection recovery, a bogus conn_p pointer could
      end up being used to send the ISCSI_OP_ASYNC_EVENT + DROPPING_CONNECTION
      notifying the initiator that cmd->logout_cid has failed.
      
      The bug was manifesting itself as an OOPs in iscsit_allocate_cmd() with
      a bogus conn_p pointer in iscsit_build_conn_drop_async_message().
      Reported-by: NArshad Hussain <arshad.hussain@calsoftinc.com>
      Reported-by: Nsantosh kulkarni <santosh.kulkarni@calsoftinc.com>
      Cc: <stable@vger.kernel.org> #3.1+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d444edc6
    • N
      target: Add TFO->abort_task for aborted task resources release · 131e6abc
      Nicholas Bellinger 提交于
      Now that TASK_ABORTED status is not generated for all cases by
      TMR ABORT_TASK + LUN_RESET, a new TFO->abort_task() caller is
      necessary in order to give fabric drivers a chance to unmap
      hardware / software resources before the se_cmd descriptor is
      released via the normal TFO->release_cmd() codepath.
      
      This patch adds TFO->aborted_task() in core_tmr_abort_task()
      in place of the original transport_send_task_abort(), and
      also updates all fabric drivers to implement this caller.
      
      The fabric drivers that include changes to perform cleanup
      via ->aborted_task() are:
      
        - iscsi-target
        - iser-target
        - srpt
        - tcm_qla2xxx
      
      The fabric drivers that currently set ->aborted_task() to
      NOPs are:
      
        - loopback
        - tcm_fc
        - usb-gadget
        - sbp-target
        - vhost-scsi
      
      For the latter five, there appears to be no additional cleanup
      required before invoking TFO->release_cmd() to release the
      se_cmd descriptor.
      
      v2 changes:
        - Move ->aborted_task() call into transport_cmd_finish_abort (Alex)
      
      Cc: Alex Leung <amleung21@yahoo.com>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Roland Dreier <roland@kernel.org>
      Cc: Vu Pham <vu@mellanox.com>
      Cc: Chris Boot <bootc@bootc.net>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      131e6abc
    • A
      iscsi-target: Add missing NopOUT->flag (LMB) sanity check · a3662605
      Arshad Hussain 提交于
      This patch adds check for NopOUT->flag (LMB) which is a mandatory
      as per RFC 3720 Section 10.18.
      
      (Fix up context changes for v3.14-rc code - nab)
      Signed-off-by: NArshad Hussain <arshad.hussain@calsoftinc.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a3662605
  29. 05 3月, 2014 1 次提交
    • N
      iscsi/iser-target: Fix isert_conn->state hung shutdown issues · defd8848
      Nicholas Bellinger 提交于
      This patch addresses a couple of different hug shutdown issues
      related to wait_event() + isert_conn->state.  First, it changes
      isert_conn->conn_wait + isert_conn->conn_wait_comp_err from
      waitqueues to completions, and sets ISER_CONN_TERMINATING from
      within isert_disconnect_work().
      
      Second, it splits isert_free_conn() into isert_wait_conn() that
      is called earlier in iscsit_close_connection() to ensure that
      all outstanding commands have completed before continuing.
      
      Finally, it breaks isert_cq_comp_err() into seperate TX / RX
      related code, and adds logic in isert_cq_rx_comp_err() to wait
      for outstanding commands to complete before setting ISER_CONN_DOWN
      and calling complete(&isert_conn->conn_wait_comp_err).
      Acked-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: <stable@vger.kernel.org> #3.10+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      defd8848