linux/include
Roland Dreier 9a7f545e75 target: Report correct response length for some commands
commit 2426bd456a upstream.

When an initiator sends an allocation length bigger than what its
command consumes, the target should only return the actual response data
and set the residual length to the unused part of the allocation length.

Add a helper function that command handlers (INQUIRY, READ CAPACITY,
etc) can use to do this correctly, and use this code to get the correct
residual for commands that don't use the full initiator allocation in the
handlers for READ CAPACITY, READ CAPACITY(16), INQUIRY, MODE SENSE and
REPORT LUNS.

This addresses a handful of failures as reported by Christophe with
the Windows Certification Kit:

  http://permalink.gmane.org/gmane.linux.scsi.target.devel/6515

Signed-off-by: Roland Dreier <roland@purestorage.com>
Tested-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-30 20:12:00 -07:00
..
acpi Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica' 2014-01-29 11:47:18 +01:00
asm-generic mm: use paravirt friendly ops for NUMA hinting ptes 2014-05-31 13:20:30 -07:00
clocksource
crypto crypto: scatterwalk - Use sg_chain_ptr on chain entries 2013-12-09 19:58:52 +08:00
drm Merge tag 'ttm-fixes-3.14-2014-02-18' of git://people.freedesktop.org/~thomash/linux into drm-fixes 2014-02-19 08:21:26 +10:00
dt-bindings dt: tegra: remove non-existent clock IDs 2014-05-06 07:59:38 -07:00
keys
kvm ARM: KVM: fix non-VGIC compilation 2014-03-06 09:47:42 +01:00
linux ACPI: add dynamic_debug support 2014-06-30 20:11:58 -07:00
math-emu math-emu: fix floating-point to integer overflow detection 2014-01-07 18:36:24 -06:00
media [media] saa6588: add support for non-blocking mode 2014-01-07 07:42:19 -02:00
memory
misc
net net: fix inet_getid() and ipv6_select_ident() bugs 2014-06-26 15:15:39 -04:00
pcmcia
ras
rdma IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler 2014-05-06 07:59:28 -07:00
rxrpc
scsi scsi: fix our current target reap infrastructure 2014-05-31 13:20:27 -07:00
sound ALSA: control: Protect user controls against concurrent access 2014-06-26 15:15:43 -04:00
target target: Report correct response length for some commands 2014-06-30 20:12:00 -07:00
trace trace: module: Maintain a valid user count 2014-06-07 10:28:20 -07:00
uapi ALSA: compress: Cancel the optimization of compiler and fix the size of struct for all platform. 2014-06-26 15:15:42 -04:00
video video: pxa168fb: Cleanup pxa168fb.h file 2014-01-17 10:57:43 +02:00
xen Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2014-02-14 10:45:18 -08:00
Kbuild