numam-spdk/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: iSCSI connection use spdk_scsi_dev_get_first/next_lun() to iterate LUNs 2021-10-11 10:08:22 +00:00
conn.h trace: move all trace definitions to a separate file 2021-10-20 07:22:00 +00:00
init_grp.c subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00
init_grp.h subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00
iscsi_rpc.c iscsi: Set resource pool size to the predetermined values to run with little memory 2021-06-17 08:59:18 +00:00
iscsi_subsystem.c iscsi: Fix data digest degradation by restoring the original code 2021-07-07 07:26:23 +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
iscsi.h iscsi: Set resource pool size to the predetermined values to run with little memory 2021-06-17 08:59:18 +00:00
Makefile so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
md5.c lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in md5.h 2020-04-20 07:38:29 +00:00
md5.h lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in md5.h 2020-04-20 07:38:29 +00:00
param.c lib/iscsi: add a comment for iscsi_parse_params() 2021-03-26 21:06:15 +00:00
param.h lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in param.h 2020-04-20 07:38:29 +00:00
portal_grp.c lib/iscsi: Add portal_group_resume() and add pause parameter to portal_group_open() 2020-11-24 08:20:37 +00:00
portal_grp.h lib/iscsi: Add portal_group_resume() and add pause parameter to portal_group_open() 2020-11-24 08:20:37 +00:00
spdk_iscsi.map subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00
task.c lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence 2021-04-19 12:47:40 +00:00
task.h lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence 2021-04-19 12:47:40 +00:00
tgt_node.c iscsi: iSCSI target uses spdk_scsi_dev_get_first/next_lun() to iterate LUNs 2021-10-11 10:08:22 +00:00
tgt_node.h subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00