diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-04-07 21:53:27 +0000 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-05-04 11:50:10 +0200 |
commit | 15a557ae69ea1e86aa8db5c9a48f7406d9235b72 (patch) | |
tree | 9e49185e3690903dd7e78308b455312d5be2d5c5 /lib/crc7.c | |
parent | 616d9390b1db74097735ac58346d164d2fa2d16b (diff) |
target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling
commit c8e639852ad720499912acedfd6b072325fd2807 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: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'lib/crc7.c')
0 files changed, 0 insertions, 0 deletions