numam-spdk/lib/iscsi
Shuhei Matsumoto a02ab95ebb iscsi: Bug fix for residual count when length of data transfer from SCSI was 0
This bug was caused by the following two changes:

iscsi: Remove duplication of the variable for write completion to bdev
https://review.gerrithub.io/#/c/393582/

iscsi: restore data_transferred accumulation for read
https://review.gerrithub.io/#/c/393713/

For write, bytes_completed is always equal to data_transferred. However,
for read, bytes_completed is based on expected data transfer length and
data_transferred is actual read size. Hence bytes_completed cannot be
used to calculate residual counts.

One of the reason why this bug cannot be found was that there was not any
test case when task->scsi.data_transferred is 0 and task->scsi.length is
not 0. Hence UT code is also added.

Same bug will occur for read sense data. Hence UT code for read sense data
is added in the next patch.

Change-Id: Ib1a283b769e5af0c2d05acb69f90948c5d658087
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417960
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-06 21:17:29 +00:00
..
acceptor.c thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
acceptor.h iscsi: login poller per portal and portal cache 2017-10-06 17:00:45 -04:00
conn.c thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
conn.h iscsi: Solve the potential no io channel issue. 2018-05-31 01:01:17 +00:00
init_grp.c iscsi: Add JSON config/info dump for initiator group. 2018-05-10 19:38:26 +00:00
init_grp.h iscsi: Add JSON config/info dump for initiator group. 2018-05-10 19:38:26 +00:00
iscsi_rpc.c subsystem/iscsi: Add iSCSI options to JSON config file 2018-06-01 20:15:59 +00:00
iscsi_subsystem.c iscsi: check the task_pool size 2018-06-11 16:39:57 +00:00
iscsi.c iscsi: Bug fix for residual count when length of data transfer from SCSI was 0 2018-07-06 21:17:29 +00:00
iscsi.h thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
Makefile build: remove $(ENV_CFLAGS) where not necessary 2018-01-03 12:05:59 -05:00
md5.c astyle: enforce braces around single-line statements 2017-12-11 11:19:32 -05:00
md5.h include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
param.c iscsi: Use braces for the body of an if, for, or while and remove blank lines 2018-06-14 03:35:28 +00:00
param.h include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
portal_grp.c iscsi: Fix two bugs of JSON config dump 2018-05-17 23:06:11 +00:00
portal_grp.h iscsi: Add JSON config/info dump for portal group. 2018-05-10 19:38:26 +00:00
task.c scsi, iscsi: move task->parent to iSCSI task 2018-01-05 00:01:37 -05:00
task.h scsi, iscsi: move task->parent to iSCSI task 2018-01-05 00:01:37 -05:00
tgt_node.c iscsi: Fix two bugs of JSON config dump 2018-05-17 23:06:11 +00:00
tgt_node.h iscsi: Add JSON config/info dump for target node. 2018-05-04 17:45:48 +00:00