WSL2-Linux-Kernel/include/target
Paolo Bonzini 32a8811ff1 target: support zero allocation length in REQUEST SENSE
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: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-09-07 11:14:21 -07:00
..
configfs_macros.h doc: fix broken references 2011-09-27 18:08:04 +02:00
target_core_backend.h target: fix use-after-free with PSCSI sense data 2012-09-05 17:20:28 -07:00
target_core_base.h target: support zero allocation length in REQUEST SENSE 2012-09-07 11:14:21 -07:00
target_core_configfs.h [SCSI] target: add initial statistics 2011-03-23 11:36:50 -05:00
target_core_fabric.h target: Allow for target_submit_cmd() returning errors 2012-07-17 17:05:05 -07:00
target_core_fabric_configfs.h [SCSI] target: Add LIO target core v4.0.0-rc6 2011-01-14 10:12:29 -06:00