linux/drivers/target
Nicholas Bellinger c8e639852a target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling
This patch fixes a bug for COMPARE_AND_WRITE handling with
fabrics using SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC.

It adds the missing allocation for cmd->t_bidi_data_sg within
transport_generic_new_cmd() that is used by COMPARE_AND_WRITE
for the initial READ payload, even if the fabric is already
providing a pre-allocated buffer for cmd->t_data_sg.

Also, fix zero-length COMPARE_AND_WRITE handling within the
compare_and_write_callback() and target_complete_ok_work()
to queue the response, skipping the initial READ.

This fixes COMPARE_AND_WRITE emulation with loopback, vhost,
and xen-backend fabric drivers using SG_TO_MEM_NOALLOC.

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org> # v3.12+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2015-04-14 12:37:38 -07:00
..
iscsi target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
loopback target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
sbp target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
tcm_fc target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
Kconfig target: Add a user-passthrough backstore 2014-10-03 11:15:20 -07:00
Makefile target: Add a user-passthrough backstore 2014-10-03 11:15:20 -07:00
target_core_alua.c scsi: rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 2014-11-24 20:01:40 +01:00
target_core_alua.h
target_core_configfs.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_device.c target: Drop left-over fabric_max_sectors attribute 2015-01-09 15:22:05 -08:00
target_core_fabric_configfs.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_fabric_lib.c target: fix pr_out length in iscsi_parse_pr_out_transport_id 2014-09-17 15:17:35 -07:00
target_core_file.c target/file: Add checks for backend DIF emulation 2015-04-07 23:27:44 -07:00
target_core_file.h
target_core_hba.c target: Move dev_cit to struct se_subsystem_api 2014-12-01 21:35:22 -08:00
target_core_iblock.c target/iblock: Add checks for backend DIF emulation 2015-04-07 23:27:44 -07:00
target_core_iblock.h
target_core_internal.h target: move external declarations to a headers 2015-03-26 14:51:53 -07:00
target_core_pr.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_pr.h target: Fix APTPL metadata handling for dynamic MappedLUNs 2014-10-04 05:40:19 +00:00
target_core_pscsi.c SCSI for-linus on 20141220 2014-12-20 13:42:57 -08:00
target_core_pscsi.h
target_core_rd.c target/rd: reduce code duplication in rd_execute_rw() 2015-04-07 23:27:59 -07:00
target_core_rd.h
target_core_sbc.c target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling 2015-04-14 12:37:38 -07:00
target_core_spc.c target: Update SPC/SBC emulation for sess_prot_type 2015-04-07 23:26:09 -07:00
target_core_stat.c
target_core_tmr.c target: simplify core_tmr_abort_task 2014-10-01 14:39:10 -07:00
target_core_tpg.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_transport.c target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling 2015-04-14 12:37:38 -07:00
target_core_ua.c target: encapsulate smp_mb__after_atomic() 2014-10-01 14:39:06 -07:00
target_core_ua.h
target_core_user.c target: add missing __user annotations 2015-03-26 14:53:17 -07:00
target_core_xcopy.c target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_xcopy.h