1. 04 11月, 2011 2 次提交
    • C
      target: split core_scsi2_emulate_crh · eacac00c
      Christoph Hellwig 提交于
      Split core_scsi2_emulate_crh into one routine each for the reserve and
      release side.  The common code now is in a helper called by both
      routines.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      eacac00c
    • N
      target: Add generic active I/O shutdown logic · a17f091d
      Nicholas Bellinger 提交于
      This patch adds the initial pieces of generic active I/O shutdown logic.
      This is intended to be a 'opt-in' feature for fabric modules that
      includes the following functions to provide a mechinism for fabric
      modules to track se_cmd via se_session->sess_cmd_list:
      
      *) target_get_sess_cmd() - Add se_cmd to sess->sess_cmd_list, called
         from fabric module incoming I/O path.
      *) target_put_sess_cmd() - Check for completion or drop se_cmd from
         ->sess_cmd_list
      *) target_splice_sess_cmd_list() - Splice active I/O list from
         ->sess_cmd_list to ->sess_wait_list, can called with HW fabric
         lock held.
      *) target_wait_for_sess_cmds() - Walk ->sess_wait_list waiting on
         individual ->cmd_wait_comp.  Optional transport_wait_for_tasks()
         call.
      
      target_splice_sess_cmd_list() is allowed to be called under HW fabric
      lock, and performs the splice into se_sess->sess_wait_list and set
      se_cmd->cmd_wait_set.  Then target_wait_for_sess_cmds() walks the list
      waiting for individual target_put_sess_cmd() fabric callbacks to
      complete.
      
      It also adds TFO->check_release_cmd() to split the completion and memory
      release calls, where a fabric module uses target_put_sess_cmd() to check
      for I/O completion during session shutdown.  This is currently pushed out
      into fabric modules as current fabric code may sleep here waiting for
      TFO->check_stop_free() to complete in main response path, and because
      target_wait_for_sess_cmds() calling TFO->release_cmd() to free fabric
      descriptor memory directly.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      a17f091d
  2. 03 11月, 2011 1 次提交
  3. 02 11月, 2011 6 次提交
    • D
      target/pscsi: blk_make_request() returns an ERR_PTR() · ed327ed3
      Dan Carpenter 提交于
      The check is wrong here because blk_make_request() returns an
      ERR_PTR() and it doesn't return NULL.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      ed327ed3
    • N
      target: Remove core TRANSPORT_FREE_CMD_INTR usage · 3151d069
      Nicholas Bellinger 提交于
      This patch drops TRANSPORT_FREE_CMD_INTR usage from target core, which
      includes the removal of transport_generic_free_cmd_intr() symbol,
      TRANSPORT_FREE_CMD_INTR usage in transport_processing_thread(), and
      special case LUN_RESET handling to skip TRANSPORT_FREE_CMD_INTR processing
      in core_tmr_drain_cmd_list().  We now expect that fabric modules will
      use an internal workqueue to provide process context when releasing
      se_cmd descriptor resources via transport_generic_free_cmd().
      Reported-by: NChristoph Hellwig <hch@lst.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Madhuranath Iyengar <mni@risingtidesystems.com>
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      3151d069
    • N
      target: Make TFO->check_stop_free return free status · 88dd9e26
      Nicholas Bellinger 提交于
      This patch converts target_core_fabric_ops->check_stop_free() usage in
      transport_cmd_check_stop() and associated fabric module usage to
      return '1' when the passed se_cmd has been released directly within
      ->check_stop_free(), or return '0' when the passed se_cmd has not
      been released.
      
      This addresses an issue where transport_cmd_finish_abort() ->
      transport_cmd_check_stop_to_fabric() was leaking descriptors during
      LUN_RESET for modules using ->check_stop_free(), but not directly
      releasing se_cmd in all cases.
      
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      88dd9e26
    • N
      iscsi-target: Fix non-immediate TMR handling · 5a4c8666
      Nicholas Bellinger 提交于
      This patch addresses two issues with non immediate TMR handling in
      iscsit_handle_task_mgt_cmd().  The first involves breakage due to
      v3.1-rc conversion of iscsit_sequence_cmd(), which upon good status
      would hit the iscsit_add_reject_from_cmd() block of code.  This patch
      adds an explict check for CMDSN_ERROR_CANNOT_RECOVER.
      
      The second adds a check to return when non immediate TMR operation is
      detected after iscsit_ack_from_expstatsn(), as iscsit_sequence_cmd()
      -> iscsit_execute_cmd() will have called transport_generic_handle_tmr()
      for the non immediate TMR case already.
      
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5a4c8666
    • N
      iscsi-target: Add missing CMDSN_LOWER_THAN_EXP check in iscsit_handle_scsi_cmd · 7e32da55
      Nicholas Bellinger 提交于
      This patch adds a missing CMDSN_LOWER_THAN_EXP return check for
      iscsit_sequence_cmd() in iscsit_handle_scsi_cmd() that was incorrectly
      dropped during the v3.1-rc cleanups to use iscsit_sequence_cmd().
      
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7e32da55
    • J
      target: Avoid double list_del for aborted se_tmr_req · b8a11d73
      Joern Engel 提交于
      After the list_del() in core_tmr_drain_tmr_list(),
      core_tmr_release_req() would list_del() the same object again.
      
      Call graph:
              core_tmr_drain_tmr_list
              transport_cmd_finish_abort_tmr
              transport_generic_remove
              transport_free_se_cmd
              core_tmr_release_req
      
      So use list_del_init(), as list_del() of an initialized list_head is
      safe and essentially a nop.  In the CONFIG_DEBUG_LIST case, list_del()
      actually poisons the list_head, but that is fine as we free the object
      directly afterwards.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      b8a11d73
  4. 27 10月, 2011 6 次提交
    • J
      target: Minor cleanups to core_tmr_drain_tmr_list · abc1fd4f
      Joern Engel 提交于
      This patch adds a handful minor cleanups to core_tmr_drain_tmr_list() that
      remove an unnecessary NULL check, use list_for_each_entry_safe() instead of
      list_entry(), and makes the drain_tmr_list walk use *tmr_p instead of
      directly referencing the passed *tmr function parameter.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: Joern Engel <joern@logfs.org>
      Reviewed-by: NRoland Dreier <roland@purestorage.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      abc1fd4f
    • J
      target: Fix wrong se_tmr being added to drain_tmr_list · 6eb40b2a
      Joern Engel 提交于
      This patch fixes another bug from LUN_RESET re-org fallout in
      core_tmr_drain_tmr_list() that was adding the wrong se_tmr_req
      into the local drain_tmr_list to be walked + released.
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: Joern Engel <joern@logfs.org>
      Reviewed-by: NRoland Dreier <roland@purestorage.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6eb40b2a
    • J
      target: Fix incorrect se_cmd assignment in core_tmr_drain_tmr_list · 80ccbc8e
      Joern Engel 提交于
      This patch fixes a bug in core_tmr_drain_tmr_list() where drain_tmr_list
      was using the wrong se_tmr_req for cmd assignment due to a typo during the
      LUN_RESET re-org.  This was resulting in general protection faults while
      using the leftover bogus *tmr_p pointer from list_for_each_entry_safe().
      Signed-off-by: NJoern Engel <joern@logfs.org>
      Cc: Joern Engel <joern@logfs.org>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      80ccbc8e
    • N
      target: Check -ENOMEM to signal QUEUE_FULL from fabric callbacks · f147abb4
      Nicholas Bellinger 提交于
      This patch changes target core to also check for -ENOMEM from fabric callbacks
      to signal QUEUE_FULL status, instead of just -EAGAIN in order to catch a
      larger set of fabric failure cases that want to trigger QUEUE_FULL logic.
      This includes the callbacks for ->write_pending(), ->queue_data_in() and
      ->queue_status().
      
      It also makes transport_generic_write_pending() return zero upon QUEUE_FULL,
      and removes two unnecessary -EAGAIN checks to catch write pending QUEUE_FULL
      cases from transport_generic_new_cmd() failures in transport_handle_cdb_direct()
      and transport_processing_thread():TRANSPORT_NEW_CMD_MAP state.
      Reported-by: NBart Van Assche <bvanassche@acm.org>
      Cc: Bart Van Assche <bvanassche@acm.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      f147abb4
    • N
      tcm_loop: Add explict read buffer memset for SCF_SCSI_CONTROL_SG_IO_CDB · 8cd79f24
      Nicholas Bellinger 提交于
      This patch addresses an issue with buggy userspace code sending I/O
      via scsi-generic that does not explictly clear their associated read
      buffers.  It adds an explict memset of the first SGL entry within
      tcm_loop_new_cmd_map() for SCF_SCSI_CONTROL_SG_IO_CDB payloads that
      are currently guaranteed to be a single SGL by target-core code.
      
      This issue is a side effect of the v3.1-rc1 merge to remove the
      extra memcpy between certain control CDB types using a contigious
      + cleared buffer in target-core, and performing a memcpy into the
      SGL list within tcm_loop.
      
      It was originally mainfesting itself by udev + scsi_id + scsi-generic
      not properly setting up the expected /dev/disk/by-id/ symlinks because
      the INQUIRY payload was containing extra bogus data preventing the
      proper NAA IEEE WWN from being parsed by userspace.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      8cd79f24
    • N
      target: Fix compile warning w/ missing module.h include · c9abb9bb
      Nicholas Bellinger 提交于
      This patch fixes the following compile warning in target_core_cdb.c in
      recent linux-next code due to the new use of EXPORT_SYMBOL() for
      target_get_task_cdb().
      
      drivers/target/target_core_cdb.c:1316: warning: data definition has no type or storage class
      drivers/target/target_core_cdb.c:1316: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’
      drivers/target/target_core_cdb.c:1316: warning: parameter names (without types) in function declaration
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      c9abb9bb
  5. 24 10月, 2011 25 次提交