1. 04 Nov, 2011 1 commit
    • Nicholas Bellinger's avatar
      target: Add generic active I/O shutdown logic · a17f091d
      Nicholas Bellinger authored
      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: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      a17f091d
  2. 02 Nov, 2011 7 commits
  3. 27 Oct, 2011 4 commits
  4. 26 Oct, 2011 2 commits
    • Nicholas Bellinger's avatar
      tcm_loop: Add explict read buffer memset for SCF_SCSI_CONTROL_SG_IO_CDB · 8cd79f24
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      8cd79f24
    • Nicholas Bellinger's avatar
      target: Fix compile warning w/ missing module.h include · c9abb9bb
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      c9abb9bb
  5. 24 Oct, 2011 26 commits