1. 27 Oct, 2011 1 commit
    • Nicholas Bellinger's avatar
      target: Check -ENOMEM to signal QUEUE_FULL from fabric callbacks · f147abb4
      Nicholas Bellinger authored
      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: default avatarBart 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: default avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      f147abb4
  2. 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
  3. 24 Oct, 2011 37 commits