1. 01 11月, 2012 4 次提交
    • R
      iscsi-target: Fix missed wakeup race in TX thread · d5627acb
      Roland Dreier 提交于
      The sleeping code in iscsi_target_tx_thread() is susceptible to the classic
      missed wakeup race:
      
       - TX thread finishes handle_immediate_queue() and handle_response_queue(),
         thinks both queues are empty.
       - Another thread adds a queue entry and does wake_up_process(), which does
         nothing because the TX thread is still awake.
       - TX thread does schedule_timeout() and sleeps forever.
      
      In practice this can kill an iSCSI connection if for example an initiator
      does single-threaded writes and the target misses the wakeup window when
      queueing an R2T; in this case the connection will be stuck until the
      initiator loses patience and does some task management operation (or kills
      the connection entirely).
      
      Fix this by converting to wait_event_interruptible(), which does not
      suffer from this sort of race.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d5627acb
    • R
      target: Avoid integer overflow in se_dev_align_max_sectors() · 3e03989b
      Roland Dreier 提交于
      The expression (max_sectors * block_size) might overflow a u32
      (indeed, since iblock sets max_hw_sectors to UINT_MAX, it is
      guaranteed to overflow and end up with a much-too-small result in many
      common cases).  Fix this by doing an equivalent calculation that
      doesn't require multiplication.
      
      While we're touching this code, avoid splitting a printk format across
      two lines and use pr_info(...) instead of printk(KERN_INFO ...).
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3e03989b
    • R
      target: Don't return success from module_init() if setup fails · 0d0f9dfb
      Roland Dreier 提交于
      If the call to core_dev_release_virtual_lun0() fails, then nothing
      sets ret to anything other than 0, so even though everything is
      torn down and freed, target_core_init_configfs() will seem to succeed
      and the module will be loaded.  Fix this by passing the return value
      on up the chain.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      0d0f9dfb
    • N
      target: Re-add explict zeroing of INQUIRY bounce buffer memory · dea5f099
      Nicholas Bellinger 提交于
      This patch fixes a regression in spc_emulate_inquiry() code where the
      local scope bounce buffer was no longer getting it's memory zeroed,
      causing various problems with SCSI initiators that depend upon areas
      of INQUIRY EVPD=0x83 payload having been zeroed.
      
      This bug was introduced with the following v3.7-rc1 patch + CC'ed
      stable commit:
      
      commit ffe7b0e9
      Author: Paolo Bonzini <pbonzini@redhat.com>
      Date:   Fri Sep 7 17:30:38 2012 +0200
      
          target: support zero allocation length in INQUIRY
      
      Go ahead and re-add the missing memset of bounce buffer memory to be
      copied into the outgoing se_cmd descriptor kmapped SGL payload.
      Reported-by: NKelsey Prantis <kelsey.prantis@intel.com>
      Cc: Kelsey Prantis <kelsey.prantis@intel.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      dea5f099
  2. 27 10月, 2012 2 次提交
    • B
      target: reintroduce some obsolete SCSI-2 commands · 1a1ff38c
      Bernhard Kohl 提交于
      With kernel 3.6 some obsolete SCSI-2 commands including SEEK_10 have
      have been removed by commit 1fd032ee
      "target: move code for CDB emulation".
      
      There are still clients out there which use these old SCSI-2 commands.
      This mainly happens when running VMs with legacy guest systems,
      connected via SCSI command pass-through to iSCSI targets. Make them
      happy and return status GOOD.
      
      Many real SCSI disks or external iSCSI storage devices still support
      these old commands. So let's make LIO backward compatible as well.
      
      This patch adds support for the previously removed SEEK_10 and
      additionally the SEEK_6 and REZERO_UNIT commands.
      Signed-off-by: NBernhard Kohl <bernhard.kohl@nsn.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1a1ff38c
    • N
      target: Fix double-free of se_cmd in target_complete_tmr_failure · e13d5fef
      Nicholas Bellinger 提交于
      Fabric drivers currently expect to internally release se_cmd in the event
      of a TMR failure during target_submit_tmr(), which means the immediate call
      to transport_generic_free_cmd() after TFO->queue_tm_rsp() from within
      target_complete_tmr_failure() workqueue context is wrong.
      
      This is done as some fabrics expect TMR operations to be acknowledged
      before releasing the descriptor, so the assumption that core is releasing
      se_cmd associated TMR memory is incorrect.  This fixes a OOPs where
      transport_generic_free_cmd() was being called more than once.
      
      This bug was originally observed with tcm_qla2xxx fabric ports.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e13d5fef
  3. 04 10月, 2012 3 次提交
    • N
      iscsi-target: Bump defaults for nopin_timeout + nopin_response_timeout values · cf0eb28d
      Nicholas Bellinger 提交于
      This patch increases the default for nopin_timeout to 15 seconds (wait
      between sending a new NopIN ping) and nopin_response_timeout to 30 seconds
      (wait for NopOUT response before failing the connection) in order to avoid
      false positives by iSCSI Initiators who are not always able (under load) to
      respond to NopIN echo PING requests within the current 5 second window.
      
      False positives have been observed recently using Open-iSCSI code on v3.3.x
      with heavy large-block READ workloads over small MTU 1 Gb/sec ports, and
      increasing these values to more reasonable defaults significantly reduces
      the possibility of false positive NopIN response timeout events under
      this specific workload.
      
      Historically these have been set low to initiate connection recovery as
      soon as possible if we don't hear a ping back, but for modern v3.x code
      on 1 -> 10 Gb/sec ports these new defaults make alot more sense.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      cf0eb28d
    • C
      iscsit: proper endianess conversions · 50e5c87d
      Christoph Hellwig 提交于
      Make sure all on the wire types are use as big endian and big endian only so
      that sparse can verify all the conversions are done right.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      50e5c87d
    • C
      iscsit: use the itt_t abstract type · 66c7db68
      Christoph Hellwig 提交于
      Use the special itt_t type defined by the iscsi headers and the initiator
      to make sure it's an opaque value.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      66c7db68
  4. 03 10月, 2012 14 次提交
  5. 23 9月, 2012 2 次提交
  6. 18 9月, 2012 15 次提交