linux/include/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 iscsi/iser-target: Add fabric_prot_type attribute support 2015-04-07 23:27:48 -07:00
configfs_macros.h doc: fix broken references 2011-09-27 18:08:04 +02:00
target_core_backend_configfs.h target: Drop left-over fabric_max_sectors attribute 2015-01-09 15:22:05 -08:00
target_core_backend.h target: Drop left-over fabric_max_sectors attribute 2015-01-09 15:22:05 -08:00
target_core_base.h target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling 2015-04-14 12:37:38 -07:00
target_core_configfs.h target: simplify the target template registration API 2015-04-14 12:28:41 -07:00
target_core_fabric_configfs.h target: Add target_show_dynamic_sessions attribute helper 2015-03-06 21:24:53 -08:00
target_core_fabric.h target: simplify the target template registration API 2015-04-14 12:28:41 -07:00