target: Reset data_length for COMPARE_AND_WRITE to NoLB * block_size
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 1 Oct 2013 23:46:37 +0000 (16:46 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 3 Oct 2013 11:24:06 +0000 (04:24 -0700)
This patch resets se_cmd->data_length for COMPARE_AND_WRITE emulation
within sbc_compare_and_write() to NoLB * block_size in order to address
a bug with FILEIO backends where a I/O failure will occur when data_length
does not match the I/O size being actually dispatched for the individual
per block READs + WRITEs.

This is done late enough in sbc_compare_and_write() after the memory
allocations have occured in transport_generic_new_cmd() to not cause
any unwanted side-effects.

Reported-by: Thomas Glanzmann <thomas@glanzmann.de>
Tested-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_sbc.c

Simple merge