Spdk/test/unit/lib/iscsi
Shuhei Matsumoto eb739d0364 iscsi: Fix the case that incoming data is split between data segment and data digest
When data segment size is 64KB and data digest is enabled, if
data segment and data digest are split into different two packets,
- pdu->mobj[0] became full first when reading data semgment,
- pdu->mobj[1] was allocated but unused and data digest was read.

In this case, two SCSI write tasks were submitted by mistake and
the second SCSI write task had no data.

Fix the bug in this patch.

When iscsi_pdu_payload_read() is called and pdu->mobj[0] is full,
allocate pdu->mobj[1] only if any of data segment remains to read.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9a0c36c05f90092c3c2122a7eb91e10976830b40
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9965
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-11-11 23:22:57 +00:00
..
conn.c iscsi: Pass iscsi_lun directly to the callback argument of spdk_scsi_lun_open() 2021-10-11 10:08:22 +00:00
init_grp.c test: optimize unit test .gitignore files 2021-08-20 07:29:57 +00:00
iscsi.c iscsi: Fix the case that incoming data is split between data segment and data digest 2021-11-11 23:22:57 +00:00
param.c test: optimize unit test .gitignore files 2021-08-20 07:29:57 +00:00
portal_grp.c test: optimize unit test .gitignore files 2021-08-20 07:29:57 +00:00
tgt_node.c scsi: Manage LUNs per device by not fixed size array but linked list 2021-10-12 09:10:18 +00:00
common.c iscsi: Fix the case that incoming data is split between data segment and data digest 2021-11-11 23:22:57 +00:00
Makefile iscsi&iscsi/ut: Unify cpumask decode between iSCSI.conf and JSON-RPC 2018-01-19 15:47:57 -05:00