linux/include/target
Nicholas Bellinger b2c9f833b0 target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling
commit c8e639852a upstream.

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>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-06 21:59:17 +02:00
..
iscsi Target/iscsi: Fix sendtargets response pdu for iser transport 2014-06-30 20:12:00 -07:00
configfs_macros.h doc: fix broken references 2011-09-27 18:08:04 +02:00
target_core_backend.h target: Report correct response length for some commands 2014-06-30 20:12:00 -07:00
target_core_base.h target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling 2015-05-06 21:59:17 +02:00
target_core_configfs.h target: Remove TF_CIT_TMPL macro 2013-10-16 13:35:02 -07:00
target_core_fabric.h target: Add protection SGLs to target_submit_cmd_map_sgls 2014-01-18 09:58:09 +00:00
target_core_fabric_configfs.h target: Add se_portal_group->tpg_auth_group 2013-07-03 19:44:31 -07:00