]> git.baikalelectronics.ru Git - kernel.git/commit
target: Fix residual overflow handling in target_complete_cmd_with_length
authorSumit Rai <sumitrai96@gmail.com>
Wed, 20 Jul 2016 20:59:42 +0000 (13:59 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 24 Jul 2016 06:34:54 +0000 (23:34 -0700)
commite11205a4561c540558dad86ed5f59533b42cf5dc
treec5fa2656c5ede92e8c2de52a0c133d0f67658ec7
parentd6a4af57e7bb15d26927545948de37cfa9ab468b
target: Fix residual overflow handling in target_complete_cmd_with_length

This patch fixes residual overflow handling to correctly set the
residual_count using SPDTL, instead of SCSI Allocation Length.

Allocation Length is the maximum value of the SPDTL and not substitute
for it, hence it shouldn’t be used to calculate ResidualCount except for
cases where SPDTL > Allocation Length and Data is truncated (in that
case both Alloc Len and SPDTL are same). (SPC 5r01 Section 4.2.5.6).

Thanks to Ajay Nair in assisting with this patch.

Signed-off-by: Sumit Rai <sumitrai96@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c