1. 21 10月, 2016 3 次提交
  2. 21 7月, 2016 1 次提交
  3. 10 5月, 2016 1 次提交
    • C
      target: make ->shutdown_session optional · 22d11759
      Christoph Hellwig 提交于
      Turns out the template and thus many drivers got the return value wrong:
      0 means the fabrics driver needs to put a session reference, which no
      driver except for the iSCSI target drivers did.  Fortunately none of these
      drivers supports explicit Node ACLs, so the bug was harmless.
      
      Even without that only qla2xxx and iscsi every did real work in
      shutdown_session, so get rid of the boilerplate code in all other
      drivers.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      22d11759
  4. 11 3月, 2016 2 次提交
    • N
      tcm_fc: Convert to TARGET_SCF_ACK_KREF I/O + TMR krefs · 91973cd6
      Nicholas Bellinger 提交于
      This patch converts tcm_fc to modern TARGET_SCF_ACK_KREF
      usage for ft_queue_status(), and fixes ft_check_stop_free()
      to return transport_generic_free_cmd() for ->cmd_kref.
      
      It also converts TM request -> ft_send_tm() to use ACK_KREF,
      and update ft_queue_tm_resp() to drop the outstanding kref
      after queueing TM response into fabric code.
      
      Cc: Vasu Dev <vasu.dev@linux.intel.com>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      91973cd6
    • N
      tcm_fc: Convert to target_alloc_session usage · 9ed59655
      Nicholas Bellinger 提交于
      This patch converts tcm_fc target mode addition of tf_sess->hash to
      port_id hlist_head using the new alloc_session callback().
      
      Cc: Vasu Dev <vasu.dev@linux.intel.com>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9ed59655
  5. 13 1月, 2016 1 次提交
    • N
      tcm_fc: Convert acl lookup to modern get_initiator_node_acl usage · 7fbef3d0
      Nicholas Bellinger 提交于
      This patch does a simple conversion of tcm_fc code to use
      proper modern core_tpg_get_initiator_node_acl() lookup using
      se_node_acl->acl_kref, and drops the legacy list walk from
      ft_acl_get().
      
      Note the original lookup also took node_name into account,
      but since ft_init_nodeacl() only ever sets port_name for
      se_node_acl->acl_group within configfs, this is purely
      a mechanical change.
      
      As per HCH, go ahead and fold ft_acl_get() into original
      caller.
      
      Cc: Vasu Dev <vasu.dev@linux.intel.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Andy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7fbef3d0
  6. 08 1月, 2016 2 次提交
    • B
      tcm_fc: Wait for command completion before freeing a session · de7ee9a2
      Bart Van Assche 提交于
      This patch avoids that the following kernel crash can occur with
      later patches in this patch series:
      
      general protection fault: 0000 [#1] SMP
      CPU: 0 PID: 6 Comm: kworker/u8:0 Not tainted 4.3.0-rc1-debug+ #1
      Workqueue: tmr-fileio target_tmr_work [target_core_mod]
      Call Trace:
       [<ffffffff810a6915>] lock_acquire+0x65/0x90
       [<ffffffff815e740b>] _raw_spin_lock_irqsave+0x4b/0x60
       [<ffffffffa03bc7ca>] target_release_cmd_kref+0x2a/0xa0 [target_core_mod]
       [<ffffffffa03bd418>] target_put_sess_cmd+0x28/0x50 [target_core_mod]
       [<ffffffffa03bad50>] core_tmr_lun_reset+0x390/0x640 [target_core_mod]
       [<ffffffffa03bce50>] target_tmr_work+0x80/0xd0 [target_core_mod]
       [<ffffffff81070e6d>] process_one_work+0x19d/0x430
       [<ffffffff8107120f>] worker_thread+0x10f/0x460
       [<ffffffff810772ba>] kthread+0xea/0x100
       [<ffffffff815e7a2f>] ret_from_fork+0x3f/0x70
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      de7ee9a2
    • A
      target/fcoe: Add tag support to tcm_fc · 091b7062
      Andy Grover 提交于
      Add the 'tag' attribute to FC node ACLs. This is not used by kernel code,
      but gives userspace a place to store a tag string. This is used to provide
      support for initiator groups in targetcli.
      
      Just copy iscsi's implementation for tcm_fc. A few other fabrics that
      support acls also need this, to be submitted separately after the holidays.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      091b7062
  7. 07 1月, 2016 1 次提交
  8. 14 10月, 2015 1 次提交
  9. 01 8月, 2015 1 次提交
  10. 16 6月, 2015 1 次提交
    • N
      target: Drop unnecessary core_tpg_register TFO parameter · bc0c94b1
      Nicholas Bellinger 提交于
      This patch drops unnecessary target_core_fabric_ops parameter usage
      for core_tpg_register() during fabric driver TFO->fabric_make_tpg()
      se_portal_group creation callback execution.
      
      Instead, use the existing se_wwn->wwn_tf->tf_ops pointer to ensure
      fabric driver is really using the same TFO provided at module_init
      time.
      
      Also go ahead and drop the forward TFO declarations tree-wide, and
      handling the special case for iscsi-target discovery TPG.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bc0c94b1
  11. 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
  12. 01 6月, 2015 1 次提交
  13. 31 5月, 2015 9 次提交
  14. 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
  15. 20 3月, 2015 1 次提交
  16. 04 12月, 2014 1 次提交
  17. 16 9月, 2014 1 次提交
  18. 07 6月, 2014 2 次提交
  19. 16 5月, 2014 1 次提交
    • N
      tcm_fc: Fix free-after-use regression in ft_free_cmd · ed8ec8f7
      Nicholas Bellinger 提交于
      This patch fixes a free-after-use regression in ft_free_cmd(), where
      ft_sess_put() is called with cmd->sess after percpu_ida_free() has
      already released the tag.
      
      Fix this bug by saving the ft_sess pointer ahead of percpu_ida_free(),
      and pass it directly to ft_sess_put().
      
      The regression was originally introduced in v3.13-rc1 commit:
      
        commit 5f544cfa
        Author: Nicholas Bellinger <nab@daterainc.com>
        Date:   Mon Sep 23 12:12:42 2013 -0700
      
            tcm_fc: Convert to per-cpu command map pre-allocation of ft_cmd
      Reported-by: NJun Wu <jwu@stormojo.com>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: <stable@vger.kernel.org> #3.13+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ed8ec8f7
  20. 12 4月, 2014 6 次提交
  21. 07 4月, 2014 2 次提交
    • 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
      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