From 6238e1a2d34a658a7eb83801b7f27f7233fc5941 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Mon, 4 Jan 2021 22:23:58 +0800 Subject: [PATCH] lib/iscsi: directly use task->scsi.offset in iscsi_send_datain For sending data in pdus, we can direclty use task->scsi.offset, because task->scsi.offset is already set it before (in functions iscsi_conn_handle_queued_datain_tasks). So we should not update this offset in the task structure again. Signed-off-by: Ziye Yang Change-Id: I873a6f7fb174145fd90fe84a00a80a4de2d49161 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5753 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu --- lib/iscsi/iscsi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 281e10e0f7..4bca616904 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -2987,11 +2987,8 @@ iscsi_send_datain(struct spdk_iscsi_conn *conn, } DataSN++; - if (task->parent) { - offset += primary->scsi.data_transferred; - } + offset += task->scsi.offset; to_be32(&rsph->buffer_offset, (uint32_t)offset); - task->scsi.offset = offset; if (F_bit && S_bit) { to_be32(&rsph->res_cnt, residual_len);