summaryrefslogtreecommitdiff
path: root/include/target
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2014-06-10 11:07:47 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-30 20:09:45 -0700
commitbe03ed7ca0bd65ced3cc033587c9034bd2eedc0b (patch)
treebd2bd9997a22875f3a39b8220e9a2c453c7daf88 /include/target
parentdda585bfc60bccd8abc104569f7a07283f474ccf (diff)
downloadlinux-3.10-be03ed7ca0bd65ced3cc033587c9034bd2eedc0b.tar.gz
linux-3.10-be03ed7ca0bd65ced3cc033587c9034bd2eedc0b.tar.bz2
linux-3.10-be03ed7ca0bd65ced3cc033587c9034bd2eedc0b.zip
target: Report correct response length for some commands
commit 2426bd456a61407388b6e61fc5f98dbcbebc50e2 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>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_backend.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index ffa2696d64d..a63529ab9fd 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -50,6 +50,7 @@ int transport_subsystem_register(struct se_subsystem_api *);
void transport_subsystem_release(struct se_subsystem_api *);
void target_complete_cmd(struct se_cmd *, u8);
+void target_complete_cmd_with_length(struct se_cmd *, u8, int);
sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size);
sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd);