kernel_optimize_test/drivers/target
Roland Dreier d95b82461c target: Fix up handling of short INQUIRY buffers
If the initiator sends us an INQUIRY command with an allocation length
that's shorter than what we want to return, we're simply supposed to
truncate our response and return what the initiator gave us space for,
without signaling any error.  Current target code has various tests that
don't fill out the full response if the buffer is too short and
sometimes return errors incorrectly.

Fix this up by allocating a bounce buffer for INQUIRY responses if we
need to, ie if we have cmd->data_length too small as well as
SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC set in cmd->se_cmd_flags -- for most
fabrics, we always allocate at least a full page, but for tcm_loop we
may have a small buffer coming directly from the SCSI stack.

This lets us delete a lot of cmd->data_length checking, and also makes
our INQUIRY handling correct per SPC in a lot more cases.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-02-25 14:37:49 -08:00
..
iscsi target: Add SCF_SCSI_TMR_CDB usage and drop se_tmr_req_cache 2012-02-25 14:37:47 -08:00
loopback tcm_loop: switch to using transport_handle_cdb_direct 2012-02-25 14:37:48 -08:00
tcm_fc tcm_fc: Convert ft_send_tm to use target_submit_tmr 2012-02-25 14:37:48 -08:00
Kconfig
Makefile
target_core_alua.c
target_core_alua.h
target_core_cdb.c target: Fix up handling of short INQUIRY buffers 2012-02-25 14:37:49 -08:00
target_core_configfs.c
target_core_device.c
target_core_fabric_configfs.c
target_core_fabric_lib.c
target_core_file.c
target_core_file.h
target_core_hba.c
target_core_iblock.c
target_core_iblock.h
target_core_internal.h target: Add TMR_ABORT_TASK task management support 2012-02-25 14:37:49 -08:00
target_core_pr.c
target_core_pr.h
target_core_pscsi.c
target_core_pscsi.h
target_core_rd.c
target_core_rd.h
target_core_stat.c
target_core_tmr.c target: Add TMR_ABORT_TASK task management support 2012-02-25 14:37:49 -08:00
target_core_tpg.c
target_core_transport.c target: Add TMR_ABORT_TASK task management support 2012-02-25 14:37:49 -08:00
target_core_ua.c
target_core_ua.h