1. 22 7月, 2011 3 次提交
    • R
      target: Fix double test of inquiry_prod · f22c1196
      Roland Dreier 提交于
      The code in transport_add_device_to_core_hba() really intends to make sure
      that neither inquiry_prod nor inquiry_rev is NULL.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      f22c1196
    • A
      target: Core cleanups from AGrover (round 1) · e3d6f909
      Andy Grover 提交于
      This patch contains the squashed version of a number of cleanups and
      minor fixes from Andy's initial series (round 1) for target core this
      past spring.  The condensed log looks like:
      
      target: use errno values instead of returning -1 for everything
      target: Rename transport_calc_sg_num to transport_init_task_sg
      target: Fix leak in error path in transport_init_task_sg
      target/pscsi: Remove pscsi_get_sh() usage
      target: Make two runtime checks into WARN_ONs
      target: Remove hba queue depth and convert to spin_lock_irq usage
      target: dev->dev_status_queue_obj is unused
      target: Make struct se_queue_req.cmd type struct se_cmd *
      target: Remove __transport_get_qr_from_queue()
      target: Rename se_dev->g_se_dev_list to se_dev_node
      target: Remove struct se_global
      target: Simplify scsi mib index table code
      target: Make dev_queue_obj a member of se_device instead of a pointer
      target: remove extraneous returns at end of void functions
      target: Ensure transport_dump_vpd_ident_type returns null-terminated str
      target: Function pointers don't need to use '&' to be assigned
      target: Fix comment in __transport_execute_tasks()
      target: Misc style cleanups
      target: rename struct pr_reservation_template to pr_reservation
      target: Remove #defines that just perform indirection
      target: Inline transport_get_task_from_execute_queue()
      target: Minor header comment fixes
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e3d6f909
    • N
  2. 24 6月, 2011 1 次提交
  3. 27 5月, 2011 4 次提交
    • N
      [SCSI] target: Convert TASK_ATTR to scsi_tcq.h definitions · 61db1802
      Nicholas Bellinger 提交于
      This patch converts target core and follwing scsi-misc upstream fabric
      modules to use include/scsi/scsi_tcq.h includes for SIMPLE, HEAD_OF_QUEUE
      and ORDERED SCSI tasks instead of scsi/libsas.h with TASK_ATTR*
      
      *) tcm_loop: Convert tcm_loop_allocate_core_cmd() + tcm_loop_device_reset() to
         scsi_tcq.h
      *) tcm_fc: Convert ft_send_cmd() from FCP_PTA_* to scsi_tcq.h
      Reported-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      61db1802
    • N
      [SCSI] target: Fix task->task_execute_queue=1 clear bug + LUN_RESET OOPs · ccf4d680
      Nicholas Bellinger 提交于
      This patch fixes a bug where task->task_execute_queue=1 was not being
      cleared once se_task had been removed from se_device->execute_task_list,
      resulting in an OOPs in core_tmr_lun_reset() for the task->task_active=0
      case where transport_remove_task_from_execute_queue() was incorrectly
      being called.
      
      This patch fixes two cases in transport_get_task_from_execute_queue()
      and transport_remove_task_from_execute_queue() to properly clear
      task->task_execute_queue=0 once list_del(&task->t_execute_list) has
      been called.
      
      It also adds an explict check in transport_remove_task_from_execute_queue()
      to dump_stack + return if called with task->task_execute_queue=0.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      ccf4d680
    • N
      [SCSI] target: Fix bug with task_sg chained transport_free_dev_tasks release · 42c6951e
      Nicholas Bellinger 提交于
      This patch addresses a bug in the target core release path for HW
      operation where transport_free_dev_tasks() was incorrectly being called
      from transport_lun_remove_cmd() while releasing a se_cmd reference and
      calling struct target_core_fabric_ops->queue_data_in().
      
      This would result in a OOPs with HW target mode when the release of
      se_task->task_sg[] would happen before pci_unmap_sg() can be called in
      HW target mode fabric module code.  This patch addresses the issue by
      moving transport_free_dev_tasks() from transport_lun_remove_cmd() into
      transport_generic_free_cmd(), and adding TRANSPORT_FREE_CMD_INTR and
      transport_generic_free_cmd_intr() to allow se_cmd descriptor release
      to happen fromfrom within transport_processing_thread() process context
      when release of se_cmd is not possible from HW interrupt context.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      42c6951e
    • N
      [SCSI] target: Fix multi task->task_sg[] chaining logic bug · 4a8fcc2c
      Nicholas Bellinger 提交于
      This patch fixes a bug in transport_do_task_sg_chain() used by HW target
      mode modules with sg_chain() to provide a single sg_next() walkable memory
      layout for use with pci_map_sg() and friends.  This patch addresses an
      issue with mapping multiple small block max_sector tasks across multiple
      struct se_task->task_sg[] mappings for HW target mode operation.
      
      This was causing OOPs with (cmd->t_task->t_tasks_no > 1) I/O traffic for
      HW target drivers using transport_do_task_sg_chain(), and has been tested
      so far with tcm_fc(openfcoe), tcm_qla2xxx, and ib_srpt fabrics with
      t_tasks_no > 1 IBLOCK backends using a smaller max_sectors to trigger the
      original issue.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Acked-by: NKiran Patil <kiran.patil@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      4a8fcc2c
  4. 25 5月, 2011 4 次提交
    • N
      [SCSI] target: Convert TASK_ATTR to scsi_tcq.h definitions · e66ecd50
      Nicholas Bellinger 提交于
      This patch converts target core and follwing scsi-misc upstream fabric
      modules to use include/scsi/scsi_tcq.h includes for SIMPLE, HEAD_OF_QUEUE
      and ORDERED SCSI tasks instead of scsi/libsas.h with TASK_ATTR*
      
      *) tcm_loop: Convert tcm_loop_allocate_core_cmd() + tcm_loop_device_reset() to
         scsi_tcq.h
      *) tcm_fc: Convert ft_send_cmd() from FCP_PTA_* to scsi_tcq.h
      Reported-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      e66ecd50
    • N
      [SCSI] target: Fix task->task_execute_queue=1 clear bug + LUN_RESET OOPs · af57c3ac
      Nicholas Bellinger 提交于
      This patch fixes a bug where task->task_execute_queue=1 was not being
      cleared once se_task had been removed from se_device->execute_task_list,
      resulting in an OOPs in core_tmr_lun_reset() for the task->task_active=0
      case where transport_remove_task_from_execute_queue() was incorrectly
      being called.
      
      This patch fixes two cases in transport_get_task_from_execute_queue()
      and transport_remove_task_from_execute_queue() to properly clear
      task->task_execute_queue=0 once list_del(&task->t_execute_list) has
      been called.
      
      It also adds an explict check in transport_remove_task_from_execute_queue()
      to dump_stack + return if called with task->task_execute_queue=0.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      af57c3ac
    • N
      [SCSI] target: Fix bug with task_sg chained transport_free_dev_tasks release · f4366772
      Nicholas Bellinger 提交于
      This patch addresses a bug in the target core release path for HW
      operation where transport_free_dev_tasks() was incorrectly being called
      from transport_lun_remove_cmd() while releasing a se_cmd reference and
      calling struct target_core_fabric_ops->queue_data_in().
      
      This would result in a OOPs with HW target mode when the release of
      se_task->task_sg[] would happen before pci_unmap_sg() can be called in
      HW target mode fabric module code.  This patch addresses the issue by
      moving transport_free_dev_tasks() from transport_lun_remove_cmd() into
      transport_generic_free_cmd(), and adding TRANSPORT_FREE_CMD_INTR and
      transport_generic_free_cmd_intr() to allow se_cmd descriptor release
      to happen fromfrom within transport_processing_thread() process context
      when release of se_cmd is not possible from HW interrupt context.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      f4366772
    • N
      [SCSI] target: Fix multi task->task_sg[] chaining logic bug · 97868c89
      Nicholas Bellinger 提交于
      This patch fixes a bug in transport_do_task_sg_chain() used by HW target
      mode modules with sg_chain() to provide a single sg_next() walkable memory
      layout for use with pci_map_sg() and friends.  This patch addresses an
      issue with mapping multiple small block max_sector tasks across multiple
      struct se_task->task_sg[] mappings for HW target mode operation.
      
      This was causing OOPs with (cmd->t_task->t_tasks_no > 1) I/O traffic for
      HW target drivers using transport_do_task_sg_chain(), and has been tested
      so far with tcm_fc(openfcoe), tcm_qla2xxx, and ib_srpt fabrics with
      t_tasks_no > 1 IBLOCK backends using a smaller max_sectors to trigger the
      original issue.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      Acked-by: NKiran Patil <kiran.patil@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NJames Bottomley <jbottomley@parallels.com>
      97868c89
  5. 10 4月, 2011 1 次提交
  6. 31 3月, 2011 1 次提交
  7. 24 3月, 2011 4 次提交
  8. 02 3月, 2011 1 次提交
  9. 01 3月, 2011 1 次提交
    • N
      [SCSI] target: Fix t_transport_aborted handling in LUN_RESET + active I/O shutdown · 52208ae3
      Nicholas Bellinger 提交于
      This patch addresses two outstanding bugs related to
      T_TASK(cmd)->t_transport_aborted handling during TMR LUN_RESET and
      active I/O shutdown.
      
      This first involves adding two explict t_transport_aborted=1
      assignments in core_tmr_lun_reset() in order to signal the task has
      been aborted, and updating transport_generic_wait_for_tasks() to skip
      sleeping when t_transport_aborted=1 has been set.  This fixes an issue
      where transport_generic_wait_for_tasks() would end up sleeping
      indefinately when called from fabric module context while TMR
      LUN_RESET was happening with long outstanding backend struct se_task
      not yet being completed.
      
      The second adds a missing call to
      transport_remove_task_from_execute_queue() when
      task->task_execute_queue=1 is set in order to fix an OOPs when
      task->t_execute_list has not been dropped.  It also fixes the same
      case in transport_processing_shutdown() to prevent the issue from
      happening during active I/O struct se_device shutdown.
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      52208ae3
  10. 13 2月, 2011 2 次提交
  11. 15 1月, 2011 1 次提交
    • N
      [SCSI] target: Add LIO target core v4.0.0-rc6 · c66ac9db
      Nicholas Bellinger 提交于
      LIO target is a full featured in-kernel target framework with the
      following feature set:
      
      High-performance, non-blocking, multithreaded architecture with SIMD
      support.
      
      Advanced SCSI feature set:
      
          * Persistent Reservations (PRs)
          * Asymmetric Logical Unit Assignment (ALUA)
          * Protocol and intra-nexus multiplexing, load-balancing and failover (MC/S)
          * Full Error Recovery (ERL=0,1,2)
          * Active/active task migration and session continuation (ERL=2)
          * Thin LUN provisioning (UNMAP and WRITE_SAMExx)
      
      Multiprotocol target plugins
      
      Storage media independence:
      
          * Virtualization of all storage media; transparent mapping of IO to LUNs
          * No hard limits on number of LUNs per Target; maximum LUN size ~750 TB
          * Backstores: SATA, SAS, SCSI, BluRay, DVD, FLASH, USB, ramdisk, etc.
      
      Standards compliance:
      
          * Full compliance with IETF (RFC 3720)
          * Full implementation of SPC-4 PRs and ALUA
      
      Significant code cleanups done by Christoph Hellwig.
      
      [jejb: fix up for new block bdev exclusive interface. Minor fixes from
       Randy Dunlap and Dan Carpenter.]
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
      c66ac9db