tcmu: Skip Data-Out blocks before gathering Data-In buffer for BIDI case
authorXiubo Li <lixiubo@cmss.chinamobile.com>
Fri, 31 Mar 2017 02:35:25 +0000 (10:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Apr 2017 07:31:18 +0000 (09:31 +0200)
commit5ef6f4dec559007650c762b11ca30dd74866299a
treeec37c899c5b6cad4b4e34503490905251e30e0fd
parent890aec8eae096624763bc3de313d154a3ba9d9d6
tcmu: Skip Data-Out blocks before gathering Data-In buffer for BIDI case

commit a5d68ba85801a78c892a0eb8efb711e293ed314b upstream.

For the bidirectional case, the Data-Out buffer blocks will always at
the head of the tcmu_cmd's bitmap, and before gathering the Data-In
buffer, first of all it should skip the Data-Out ones, or the device
supporting BIDI commands won't work.

Fixed: 26418649eead ("target/user: Introduce data_bitmap, replace
data_length/data_head/data_tail")
Reported-by: Ilias Tsitsimpis <iliastsi@arrikto.com>
Tested-by: Ilias Tsitsimpis <iliastsi@arrikto.com>
Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_user.c