iscsi: Update task->current_data_offset always when submitting subtask

Previously task->current_data_offset was updated by add_transfer_task().
However, the following patches will merge unsolicited data and solicited
data into a single subtask. It will be possible that add_transfer_task()
is called but subtask is not submitted. As a preparation, extract
updating task->current_data_offset into iscsi_pdu_payload_op_scsi_write().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5262bb883fa2a081be1f087181de98d4c3c24d69
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9706
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Shuhei Matsumoto 2021-09-29 12:34:11 +09:00 committed by Jim Harris
parent fe08d83716
commit 5ea834b540

View File

@ -2761,7 +2761,6 @@ add_transfer_task(struct spdk_iscsi_conn *conn, struct spdk_iscsi_task *task)
conn->pending_r2t++;
task->next_expected_r2t_offset = data_len;
task->current_data_offset = data_len;
task->current_r2t_length = 0;
task->R2TSN = 0;
/* According to RFC3720 10.8.5, 0xffffffff is
@ -3326,6 +3325,8 @@ iscsi_pdu_payload_op_scsi_write(struct spdk_iscsi_conn *conn, struct spdk_iscsi_
subtask->scsi.length = pdu->data_segment_len;
iscsi_task_associate_pdu(subtask, pdu);
task->current_data_offset = pdu->data_segment_len;
iscsi_queue_task(conn, subtask);
}
return 0;