]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix zero-length READ_CAPACITY_16 regression
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 29 Jan 2013 22:18:00 +0000 (14:18 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 29 Jan 2013 22:24:26 +0000 (14:24 -0800)
commit2b1bddde2bc28efee1a90b953e11e4b225a9701b
treed855daea82993811014a7668622a0b7ad6cdb3fa
parent979c3ec977da545c1fb3855d56aaf88540b139e0
target: Fix zero-length READ_CAPACITY_16 regression

This patch fixes a regression introduced in v3.8-rc1 code where a
zero-length READ_CAPACITY_16 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 2ac013ab3ea3f079bd73a3ed150057e1ba0ada77
  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 9e 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  SCSI Status: Good

  Sense Information:
  sense buffer empty

Also, convert sbc_emulate_readcapacity() to follow the same method
of handling transport_kmap_data_sg() return values, but we never
expect a zero-length request here.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_sbc.c