1. 08 11月, 2012 1 次提交
    • N
      target: Fix possible TFO->write_pending() sense_reason_t silent WRITE corruption · b69c1fcf
      Nicholas Bellinger 提交于
      This patch fixes a possible case in transport_generic_new_cmd() where a
      failure from TFO->write_pending() from a fabric module return something
      other than -EAGAIN or -ENOMEM would cause a failed WRITE to silently
      succeed.
      
      Go ahead and return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE for this
      special case instead of only just making noise with WARN_ON().
      
      (v2: Fix incorrect exception return for all cases)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      b69c1fcf
  2. 07 11月, 2012 6 次提交
  3. 27 10月, 2012 1 次提交
    • 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
  4. 03 10月, 2012 2 次提交
  5. 18 9月, 2012 5 次提交
  6. 08 9月, 2012 3 次提交
  7. 06 9月, 2012 3 次提交
  8. 24 8月, 2012 1 次提交
    • N
      target: Fix ->data_length re-assignment bug with SCSI overflow · 4c054ba6
      Nicholas Bellinger 提交于
      This patch fixes a long-standing bug with SCSI overflow handling
      where se_cmd->data_length was incorrectly being re-assigned to
      the larger CDB extracted allocation length, resulting in a number
      of fabric level errors that would end up causing a session reset
      in most cases.  So instead now:
      
       - Only re-assign se_cmd->data_length durining UNDERFLOW (to use the
         smaller value)
       - Use existing se_cmd->data_length for OVERFLOW (to use the smaller
         value)
      
      This fix has been tested with the following CDB to generate an
      SCSI overflow:
      
        sg_raw -r512 /dev/sdc 28 0 0 0 0 0 0 0 9 0
      
      Tested using iscsi-target, tcm_qla2xxx, loopback and tcm_vhost fabric
      ports.  Here is a bit more detail on each case:
      
       - iscsi-target: Bug with open-iscsi with overflow, sg_raw returns
                       -3584 bytes of data.
       - tcm_qla2xxx: Working as expected, returnins 512 bytes of data
       - loopback: sg_raw returns CHECK_CONDITION, from overflow rejection
                   in transport_generic_map_mem_to_cmd()
       - tcm_vhost: Same as loopback
      Reported-by: NRoland Dreier <roland@purestorage.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4c054ba6
  9. 22 8月, 2012 1 次提交
  10. 18 8月, 2012 1 次提交
    • N
      target: Fix regression bug with handling of zero-length data CDBs · 74f4cf29
      Nicholas Bellinger 提交于
      This patch fixes a regression bug with the handling of zero-length
      data CDBs within transport_generic_new_cmd() code.  The bug was introduced
      with the following commit as part of the single task conversion work:
      
        commit 4101f0a8
        Author: Christoph Hellwig <hch@infradead.org>
        Date:   Tue Apr 24 00:25:03 2012 -0400
      
            target: always allocate a single task
      
      where the zero-length check for SCF_SCSI_DATA_SG_IO_CDB was incorrectly
      changed to SCF_SCSI_CONTROL_SG_IO_CDB because of the seperate comment
      in transport_generic_new_cmd() wrt to control CDBs zero-length handling
      introduced in:
      
        commit 91ec1d35
        Author: Nicholas Bellinger <nab@linux-iscsi.org>
        Date:   Fri Jan 13 12:01:34 2012 -0800
      
            target: Add workaround for zero-length control CDB handling
      
      So go ahead and change transport_generic_new_cmd() to handle control+data
      zero-length CDBs in the same manner for this special case.
      
      Tested with iscsi-target + loopback fabric port LUNs on 3.6-rc0 code.
      
      This patch will also need to be picked up for 3.5-stable.
      
      (hch: Add proper comment in transport_generic_new_cmd)
      
      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>
      74f4cf29
  11. 17 8月, 2012 1 次提交
  12. 21 7月, 2012 1 次提交
  13. 18 7月, 2012 1 次提交
    • R
      target: Allow for target_submit_cmd() returning errors · d6dfc868
      Roland Dreier 提交于
      We want it to be possible for target_submit_cmd() to return errors up
      to its fabric module callers.  For now just update the prototype to
      return an int, and update all callers to handle non-zero return values
      as an error.
      
      This is immediately useful for tcm_qla2xxx to fix a long-standing active
      I/O session shutdown race, but tcm_fc, usb-gadget, and sbp-target the
      fabric maintainers need to check + ACK that handling a target_submit_cmd()
      failure due to session shutdown does not introduce regressions
      
      (nab: Respin against for-next after initial NACK + update docbook comment +
            fix double se_cmd init in exception path for usb-gadget)
      
      Cc: Chad Dupuis <chad.dupuis@qlogic.com>
      Cc: Arun Easi <arun.easi@qlogic.com>
      Cc: Chris Boot <bootc@bootc.net>
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Andy Grover <agrover@redhat.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d6dfc868
  14. 17 7月, 2012 13 次提交