1. 14 2月, 2013 3 次提交
  2. 30 1月, 2013 2 次提交
    • N
      target: Fix zero-length MODE_SENSE regression · cab9609b
      Nicholas Bellinger 提交于
      This patch fixes a regression introduced in v3.8-rc1 code where
      a zero-length MODE_SENSE was no longer returning GOOD status, but
      instead returning TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE to generate
      a CHECK_CONDITION status.
      
      This regression was introduced with the following commit:
      
        commit de103c93
        Author: Christoph Hellwig <hch@lst.de>
        Date:   Tue Nov 6 12:24:09 2012 -0800
      
            target: pass sense_reason as a return value
      
      and this patch has been tested with the following zero-length CDB:
      
        sg_raw /dev/sdd 5a 00 0a 00 00 00 00 00 00 00
        SCSI Status: Good
      
        Sense Information:
        sense buffer empty
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      cab9609b
    • N
      target: Fix zero-length INQUIRY additional sense code regression · 49df9fc9
      Nicholas Bellinger 提交于
      This patch fixes a minor regression introduced in v3.8-rc1 code
      where a zero-length INQUIRY was no longer returning the correct
      INVALID FIELD IN CDB additional sense code.
      
      This regression was introduced with the following commit:
      
        commit de103c93
        Author: Christoph Hellwig <hch@lst.de>
        Date:   Tue Nov 6 12:24:09 2012 -0800
      
            target: pass sense_reason as a return value
      
      and this patch has been tested with the following zero-length CDB:
      
        sg_raw /dev/sdd 12 00 83 00 00 00
        SCSI Status: Check Condition
      
        Sense Information:
         Fixed format, current;  Sense key: Illegal Request
         Additional sense: Invalid field in cdb
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      49df9fc9
  3. 28 11月, 2012 1 次提交
  4. 16 11月, 2012 1 次提交
    • N
      target: Add/check max_write_same_len device attribute + update block limits VPD · 773cbaf7
      Nicholas Bellinger 提交于
      This patch adds a new max_write_same_len device attribute for use with
      WRITE_SAME w/ UNMAP=0 backend emulation.  This can be useful for
      lowering the default backend value (IBLOCK uses 0xFFFF).
      
      Also, update block limits VPD emulation code in spc_emulate_evpd_b0() to
      report MAXIMUM WRITE SAME LENGTH, and enforce max_write_same_len during
      sbc_parse() -> sbc_setup_write_same() CDB sanity checking for all emulated
      WRITE_SAME w/ UNMAP=0 cases.
      
      (Robert: Move max_write_same_len check in sbc_setup_write_same() to
               check both WRITE_SAME w/ UNMAP=1 and w/ UNMAP=0 cases)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Robert Elliott <Elliott@hp.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      773cbaf7
  5. 07 11月, 2012 12 次提交
  6. 01 11月, 2012 1 次提交
    • 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
  7. 18 9月, 2012 2 次提交
    • P
      target: fix truncation of mode data, support zero allocation length · 7a3f369c
      Paolo Bonzini 提交于
      The offset was not bumped back to the full size after writing the
      header of the MODE SENSE response, so the last 1 or 2 bytes were
      not copied.
      
      On top of this, support zero-length requests by checking for the
      return value of transport_kmap_data_sg.
      
      Testcase: sg_raw -r20 /dev/sdb 5a 00 0a 00 00 00 00 00 14 00
          last byte should be 0x1e
          it is 0x00 without the patch
          it is correct with the patch
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7a3f369c
    • P
      target: support zero allocation length in INQUIRY · ffe7b0e9
      Paolo Bonzini 提交于
      INQUIRY processing already uses an on-heap bounce buffer for loopback,
      but not for other fabrics.  Switch this to a cheaper on-stack bounce
      buffer, similar to the one used by MODE SENSE and REQUEST SENSE, and
      use it unconditionally.  With this in place, zero allocation length is
      handled simply by checking the return address of transport_kmap_data_sg.
      
      Testcase: sg_raw /dev/sdb 12 00 83 00 00 00
          should fail with ILLEGAL REQUEST / INVALID FIELD IN CDB sense
          does not fail without the patch
          fails correctly with the series
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ffe7b0e9
  8. 08 9月, 2012 1 次提交
    • P
      target: support zero allocation length in REQUEST SENSE · 32a8811f
      Paolo Bonzini 提交于
      Similar to INQUIRY and MODE SENSE, construct the sense data in a
      buffer and later copy it to the scatterlist.  Do not do anything,
      but still clear a pending unit attention condition, if the allocation
      length is zero.
      
      However, SPC tells us that "If a REQUEST SENSE command is terminated with
      CHECK CONDITION status [and] the REQUEST SENSE command was received on
      an I_T nexus with a pending unit attention condition (i.e., before the
      device server reports CHECK CONDITION status), then the device server
      shall not clear the pending unit attention condition."  Do the
      transport_kmap_data_sg early to detect this case.
      
      It also tells us "Device servers shall not adjust the additional sense
      length to reflect truncation if the allocation length is less than the
      sense data available", so do not do that!  Note that the err variable
      is write-only.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      32a8811f
  9. 17 7月, 2012 4 次提交