1. 07 3月, 2015 1 次提交
    • N
      target: Add target_show_dynamic_sessions attribute helper · f8e471f9
      Nicholas Bellinger 提交于
      This patch adds a new helper function that can be used by fabric driver
      TPG attributes for dumping the list of active sessions with a dynamically
      generated se_node_acl. (generate_node_acl=1).
      
      It prints one se_node_acl->initiatorname per line, up to PAGE_SIZE which
      is due to the current limitiation of single page attribute output within
      sysfs and configfs code.
      
      Note that if a session is referencing a explicit NodeACL, the InitiatorName
      will not appear within dynamic_sessions output.
      Reported-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f8e471f9
  2. 04 12月, 2014 1 次提交
  3. 29 10月, 2014 1 次提交
  4. 04 10月, 2014 1 次提交
    • A
      target: Add a user-passthrough backstore · 7c9e7a6f
      Andy Grover 提交于
      Add a LIO storage engine that presents commands to userspace for execution.
      This would allow more complex backstores to be implemented out-of-kernel,
      and also make experimentation a-la FUSE (but at the SCSI level -- "SUSE"?)
      possible.
      
      It uses a mmap()able UIO device per LUN to share a command ring and data
      area. The commands are raw SCSI CDBs and iovs for in/out data. The command
      ring is also reused for returning scsi command status and optional sense
      data.
      
      This implementation is based on Shaohua Li's earlier version but heavily
      modified. Differences include:
      
      * Shared memory allocated by kernel, not locked-down user pages
      * Single ring for command request and response
      * Offsets instead of embedded pointers
      * Generic SCSI CDB passthrough instead of per-cmd specialization in ring
        format.
      * Uses UIO device instead of anon_file passed in mailbox.
      * Optional in-kernel handling of some commands.
      
      The main reason for these differences is to permit greater resiliency
      if the user process dies or hangs.
      
      Things not yet implemented (on purpose):
      
      * Zero copy. The data area is flexible enough to allow page flipping or
        backend-allocated pages to be used by fabrics, but it's not clear these
        are performance wins. Can come later.
      * Out-of-order command completion by userspace. Possible to add by just
        allowing userspace to change cmd_id in rsp cmd entries, but currently
        not supported.
      * No locks between kernel cmd submission and completion routines. Sounds
        like it's possible, but this can come later.
      * Sparse allocation of mmaped area. Current code vmallocs the whole thing.
        If the mapped area was larger and not fully mapped then the driver would
        have more freedom to change cmd and data area sizes based on demand.
      
      Current code open issues:
      
      * The use of idrs may be overkill -- we maybe can replace them with a
        simple counter to generate cmd_ids, and a hash table to get a cmd_id's
        associated pointer.
      * Use of a free-running counter for cmd ring instead of explicit modulo
        math. This would require power-of-2 cmd ring size.
      
      (Add kconfig depends NET - Randy)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7c9e7a6f
  5. 02 10月, 2014 3 次提交
    • Q
      target: Fix queue full status NULL pointer for SCF_TRANSPORT_TASK_SENSE · 082f58ac
      Quinn Tran 提交于
      During temporary resource starvation at lower transport layer, command
      is placed on queue full retry path, which expose this problem.  The TCM
      queue full handling of SCF_TRANSPORT_TASK_SENSE currently sends the same
      cmd twice to lower layer.  The 1st time led to cmd normal free path.
      The 2nd time cause Null pointer access.
      
      This regression bug was originally introduced v3.1-rc code in the
      following commit:
      
      commit e057f533
      Author: Christoph Hellwig <hch@infradead.org>
      Date:   Mon Oct 17 13:56:41 2011 -0400
      
          target: remove the transport_qf_callback se_cmd callback
      Signed-off-by: NQuinn Tran <quinn.tran@qlogic.com>
      Signed-off-by: NSaurav Kashyap <saurav.kashyap@qlogic.com>
      Cc: <stable@vger.kernel.org> # v3.1+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      082f58ac
    • J
      target: encapsulate smp_mb__after_atomic() · 33940d09
      Joern Engel 提交于
      The target code has a rather generous helping of smp_mb__after_atomic()
      throughout the code base.  Most atomic operations were followed by one
      and none were preceded by smp_mb__before_atomic(), nor accompanied by a
      comment explaining the need for a barrier.
      
      Instead of trying to prove for every case whether or not it is needed,
      this patch introduces atomic_inc_mb() and atomic_dec_mb(), which
      explicitly include the memory barriers before and after the atomic
      operation.  For now they are defined in a target header, although they
      could be of general use.
      
      Most of the existing atomic/mb combinations were replaced by the new
      helpers.  In a few cases the atomic was sandwiched in
      spin_lock/spin_unlock and I simply removed the barrier.
      
      I suspect that in most cases the correct conversion would have been to
      drop the barrier.  I also suspect that a few cases exist where a) the
      barrier was necessary and b) a second barrier before the atomic would
      have been necessary and got added by this patch.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      33940d09
    • J
      target: remove some smp_mb__after_atomic()s · 74ed7e62
      Joern Engel 提交于
      atomic_inc_return() already does an implicit memory barrier and the
      second case was moved from an atomic to a plain flag operation.  If a
      barrier were needed in the second case, it would have to be smp_mb(),
      not a variant optimized away for x86 and other architectures.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      74ed7e62
  6. 13 6月, 2014 1 次提交
    • N
      target: Fix NULL pointer dereference for XCOPY in target_put_sess_cmd · 0ed6e189
      Nicholas Bellinger 提交于
      This patch fixes a NULL pointer dereference regression bug that was
      introduced with:
      
      commit 1e1110c4
      Author: Mikulas Patocka <mpatocka@redhat.com>
      Date:   Sat May 17 06:49:22 2014 -0400
      
          target: fix memory leak on XCOPY
      
      Now that target_put_sess_cmd() -> kref_put_spinlock_irqsave() is
      called with a valid se_cmd->cmd_kref, a NULL pointer dereference
      is triggered because the XCOPY passthrough commands don't have
      an associated se_session pointer.
      
      To address this bug, go ahead and checking for a NULL se_sess pointer
      within target_put_sess_cmd(), and call se_cmd->se_tfo->release_cmd()
      to release the XCOPY's xcopy_pt_cmd memory.
      Reported-by: NThomas Glanzmann <thomas@glanzmann.de>
      Cc: Thomas Glanzmann <thomas@glanzmann.de>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org # 3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      0ed6e189
  7. 12 6月, 2014 1 次提交
  8. 10 6月, 2014 2 次提交
    • N
      target: Use complete_all for se_cmd->t_transport_stop_comp · a95d6511
      Nicholas Bellinger 提交于
      This patch fixes a bug where multiple waiters on ->t_transport_stop_comp
      occurs due to a concurrent ABORT_TASK and session reset both invoking
      transport_wait_for_tasks(), while waiting for the associated se_cmd
      descriptor backend processing to complete.
      
      For this case, complete_all() should be invoked in order to wake up
      both waiters in core_tmr_abort_task() + transport_generic_free_cmd()
      process contexts.
      
      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>
      a95d6511
    • N
      target: Set CMD_T_ACTIVE bit for Task Management Requests · f15e9cd9
      Nicholas Bellinger 提交于
      This patch fixes a bug where se_cmd descriptors associated with a
      Task Management Request (TMR) where not setting CMD_T_ACTIVE before
      being dispatched into target_tmr_work() process context.
      
      This is required in order for transport_generic_free_cmd() ->
      transport_wait_for_tasks() to wait on se_cmd->t_transport_stop_comp
      if a session reset event occurs while an ABORT_TASK is outstanding
      waiting for another I/O to complete.
      
      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>
      f15e9cd9
  9. 07 6月, 2014 1 次提交
  10. 18 5月, 2014 1 次提交
    • M
      target: fix memory leak on XCOPY · 1e1110c4
      Mikulas Patocka 提交于
      On each processed XCOPY command, two "kmalloc-512" memory objects are
      leaked. These represent two allocations of struct xcopy_pt_cmd in
      target_core_xcopy.c.
      
      The reason for the memory leak is that the cmd_kref field is not
      initialized (thus, it is zero because the allocations were done with
      kzalloc). When we decrement zero kref in target_put_sess_cmd, the result
      is not zero, thus target_release_cmd_kref is not called.
      
      This patch fixes the bug by moving kref initialization from
      target_get_sess_cmd to transport_init_se_cmd (this function is called from
      target_core_xcopy.c, so it will correctly initialize cmd_kref). It can be
      easily verified that all code that calls target_get_sess_cmd also calls
      transport_init_se_cmd earlier, thus moving kref_init shouldn't introduce
      any new problems.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org	# 3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1e1110c4
  11. 18 4月, 2014 1 次提交
  12. 07 4月, 2014 6 次提交
    • N
      target: Enable READ_STRIP emulation in target_complete_ok_work · bc005869
      Nicholas Bellinger 提交于
      This patch enables the use of READ_STRIP software emulation in
      target_complete_ok_work() code for I/O READs.
      
      This is useful when the fabric does not support READ_STRIP hardware
      offload, but would still like to interact with backend device
      that have T10 PI enabled.
      
      v2 changes:
         - Move TARGET_PROT_DIN_STRIP check from target_check_read_strip()
           into target_complete_ok_work() (Sagi)
      
      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>
      bc005869
    • N
      target: Enable WRITE_INSERT emulation in target_execute_cmd · a84bf9ee
      Nicholas Bellinger 提交于
      This patch enables WRITE_INSERT emulation in target_execute_cmd()
      in order to locally generate DIF PI before submitting the WRITE
      to the underlying backend device.
      
      This is required for fabric drivers that currently don't support
      DIF over-the-wire, in order to inact with backend devices that
      have hardware (IBLOCK) or software (FILEIO + RAMDISK) support
      for handling T10 PI.
      
      v2 changes:
         - Convert to sbc_dif_generate() usage (Sagi)
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.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>
      a84bf9ee
    • 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
    • A
      target: Fix Task Aborted Status (TAS) handling · 68259b5a
      Alex Leung 提交于
      This patch addresses three of long standing issues wrt to Task
      Aborted Status (TAS) handling.
      
      The first is the incorrect assumption in core_tmr_handle_tas_abort()
      that TASK_ABORTED status is sent for the task referenced by TMR
      ABORT_TASK, and sending TASK_ABORTED status for TMR LUN_RESET on
      the same nexus the LUN_RESET was received.
      
      The second is to ensure the lun reference count is dropped within
      transport_cmd_finish_abort() by calling transport_lun_remove_cmd()
      before invoking transport_cmd_check_stop_to_fabric().
      
      The last is to fix the delayed TAS handling to allow outstanding
      WRITEs to complete before sending the TASK_ABORTED status. This
      includes changing transport_check_aborted_status() to avoid
      processing when SCF_SEND_DELAYED_TAS has not be set, and updating
      transport_send_task_abort() to drop the SCF_SENT_DELAYED_TAS
      check.
      Signed-off-by: NAlex Leung <amleung21@yahoo.com>
      Cc: Alex Leung <amleung21@yahoo.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      68259b5a
    • S
      Target/dif: Introduce protection-passthough-only mode · b5b8e298
      Sagi Grimberg 提交于
      Some transports (iSCSI/iSER/SRP/FC) support hardware INSERT/STRIP
      capabilities while other transports like loopback/vhost-scsi need
      perform this is software.
      
      This patch allows fabrics using SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC
      to signal the early LUN scan handling case where PROTECT CDB bits
      are set, but no fabric buffer has been provided.
      
      For transports which use generic new command these buffers have yet
      to be allocated.
      
      Also this way, target may support protection information
      against legacy initiators (writes are inserted and reads
      are stripped).
      
      (Only set prot_pto for loopback during early special case - nab)
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b5b8e298
  13. 14 3月, 2014 2 次提交
  14. 24 2月, 2014 1 次提交
    • N
      target: Add DIF sense codes in transport_generic_request_failure · 94387aa7
      Nicholas Bellinger 提交于
      This patch adds the three missing DIF related sense codes within
      transport_generic_request_failure(), which are required to ensure
      that the correct ASC/ASQC is generated by the subsequent call to
      transport_send_check_condition_and_sense().
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      94387aa7
  15. 13 2月, 2014 1 次提交
  16. 30 1月, 2014 1 次提交
    • N
      target: Fix percpu_ref_put race in transport_lun_remove_cmd · 5259a06e
      Nicholas Bellinger 提交于
      This patch fixes a percpu_ref_put race for se_lun->lun_ref in
      transport_lun_remove_cmd() where ->lun_ref could end up being
      put more than once per command via different target completion
      and fabric release contexts.
      
      It adds a cmpxchg() for se_cmd->lun_ref_active to ensure that
      percpu_ref_put() is only ever called once per se_cmd.
      
      This bug was manifesting itself as a LUN shutdown regression
      bug in >= v3.13 code, where percpu_ref_kill() would end up
      hanging indefinately due to the incorrect percpu_ref count.
      
      (Change se_cmd->lun_ref_active from bool -> int to force at
       least a 4-byte cmpxchg with MIPS ll/sc ins. - Fengguang)
      Reported-by: NTommy Apel <tommyapeldk@gmail.com>
      Cc: Tommy Apel <tommyapeldk@gmail.com>
      Cc: <stable@vger.kernel.org> #3.13+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5259a06e
  17. 25 1月, 2014 1 次提交
  18. 18 1月, 2014 2 次提交
    • N
      target: Add protection SGLs to target_submit_cmd_map_sgls · def2b339
      Nicholas Bellinger 提交于
      This patch adds support to target_submit_cmd_map_sgls() for
      accepting 'sgl_prot' + 'sgl_prot_count' parameters for
      DIF protection information.
      
      Note the passed parameters are stored at se_cmd->t_prot_sg
      and se_cmd->t_prot_nents respectively.
      
      Also, update tcm_loop and vhost-scsi fabrics usage of
      target_submit_cmd_map_sgls() to take into account the
      new parameters.
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      def2b339
    • N
      target: Add DIF CHECK_CONDITION ASC/ASCQ exception cases · fcc4f17b
      Nicholas Bellinger 提交于
      This patch adds support for DIF related CHECK_CONDITION ASC/ASCQ
      exception cases into transport_send_check_condition_and_sense().
      
      This includes:
      
        LOGICAL BLOCK GUARD CHECK FAILED
        LOGICAL BLOCK APPLICATION TAG CHECK FAILED
        LOGICAL BLOCK REFERENCE TAG CHECK FAILED
      
      that used by DIF TYPE1 and TYPE3 failure cases.
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      fcc4f17b
  19. 10 1月, 2014 1 次提交
  20. 21 11月, 2013 1 次提交
  21. 14 11月, 2013 1 次提交
    • N
      target: Fix delayed Task Aborted Status (TAS) handling bug · 29f4c090
      Nicholas Bellinger 提交于
      This patch fixes a bug in delayed Task Aborted Status (TAS) handling,
      where transport_send_task_abort() was not returning for the case
      when the se_tfo->write_pending() callback indicated that last fabric
      specific WRITE PDU had not yet been received.
      
      It also adds an explicit cmd->scsi_status = SAM_STAT_TASK_ABORTED
      assignment within transport_check_aborted_status() to avoid the case
      where se_tfo->queue_status() is called when the SAM_STAT_TASK_ABORTED
      assignment + ->queue_status() in transport_send_task_abort() does not
      occur once SCF_SENT_DELAYED_TAS has been set.
      
      Cc: <stable@vger.kernel.org> #3.2+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      29f4c090
  22. 13 11月, 2013 1 次提交
  23. 08 11月, 2013 2 次提交
    • N
      target: Drop left-over se_lun->lun_cmd_list shutdown code · 4a9a6c8d
      Nicholas Bellinger 提交于
      Now with percpu refcounting for se_lun in place, go ahead and drop
      the legacy per se_cmd accounting for se_lun shutdown.
      
      This includes __transport_clear_lun_from_sessions(), the associated
      transport_lun_wait_for_tasks() logic, along with a handful of now
      unused se_cmd structure members and ->transport_state bits.
      
      Cc: Kent Overstreet <kmo@daterainc.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4a9a6c8d
    • N
      target: Add percpu refcounting for se_lun access · 5277797d
      Nicholas Bellinger 提交于
      This patch adds percpu refcounting for se_lun access that allows the
      association of an se_lun + se_cmd in transport_lookup_cmd_lun() to
      occur without an extra list_head for tracking outstanding I/O during
      se_lun shutdown.
      
      This effectively changes se_lun shutdown logic to wait for outstanding
      I/O percpu references to complete in transport_lun_remove_cmd() using
      se_lun->lun_ref_comp, instead of explicitly draining the per se_lun
      command list and waiting for individual se_cmd descriptor processing
      to complete.
      
      Cc: Kent Overstreet <kmo@daterainc.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5277797d
  24. 02 10月, 2013 1 次提交
    • N
      target: Fall back to vzalloc upon ->sess_cmd_map kzalloc failure · 8c7f6e9b
      Nicholas Bellinger 提交于
      This patch changes transport_alloc_session_tags() to fall back to
      use vzalloc when kzalloc fails for big tag_num that end up generating
      larger order allocations.
      
      Also use is_vmalloc_addr() in transport_alloc_session_tags() failure
      path, and normal transport_free_session() path to determine when
      vfree() needs to be called instead of kfree().
      
      v2 changes:
        - Use  __GFP_NOWARN | __GFP_REPEAT for sess_cmd_map kzalloc (mst)
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Asias He <asias@redhat.com>
      Cc: Kent Overstreet <kmo@daterainc.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      8c7f6e9b
  25. 11 9月, 2013 4 次提交
    • N
      target: Update copyright ownership/year information to 2013 · 4c76251e
      Nicholas Bellinger 提交于
      Update copyright ownership/year information for target-core,
      loopback, iscsi-target, tcm_qla2xx, vhost and iser-target.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4c76251e
    • N
      target: Make helpers non static for EXTENDED_COPY command setup · c5ff8d6b
      Nicholas Bellinger 提交于
      Both target_alloc_sgl() and transport_generic_map_mem_to_cmd() are
      required by EXTENDED_COPY logic when setting up internally dispatched
      command descriptors, so go ahead and make both of these non static.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Martin Petersen <martin.petersen@oracle.com>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NNicholas Bellinger <nab@daterainc.com>
      c5ff8d6b
    • N
      target: Release COMPARE_AND_WRITE mutex in generic failure path · cf6d1f09
      Nicholas Bellinger 提交于
      This patch adds a extra check for SCF_COMPARE_AND_WRITE within
      transport_generic_request_failure() to invoke the callback for
      compare_and_write_callback() or compare_and_write_done(), in
      order to release se_dev->caw_mutex from the generic failure
      path.
      
      It also adds to checks within compare_and_write_callback() to
      avoid processing when transport_generic_request_failure() occurs
      early enough that cmd->t_data_sg or cmd->t_bidi_data_sg have not
      been setup yet, nor se_dev->caw_mutex obtained from within
      sbc_compare_and_write().
      
      v4 changes:
       - Add explicit check for cmd->transport_complete_callback in
         transport_generic_request_failure() to handle case where
         sbc_compare_and_write()clears callback pointer (Dan Carpenter)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Martin Petersen <martin.petersen@oracle.com>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      cf6d1f09
    • N
      target: Add compare_and_write_post() completion callback fall through · a2890087
      Nicholas Bellinger 提交于
      This patch changes target_complete_ok_work() to fall through
      after calling the se_cmd->transport_complete_callback() ->
      compare_and_write_post() callback, by keying off the existance
      of SCF_COMPARE_AND_WRITE_POST.
      
      This is necessary because once SCF_COMPARE_AND_WRITE_POST has
      been set by compare_and_write_post(), the SCSI response needs
      to be sent via TFO->queue_status().
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Martin Petersen <martin.petersen@oracle.com>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NNicholas Bellinger <nab@daterainc.com>
      a2890087
  26. 10 9月, 2013 1 次提交