Skip to content

Commit

Permalink
iscsi: Update task->current_data_offset always when submitting subtask
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shuhei Matsumoto authored and jimharris committed Nov 11, 2021
1 parent fe08d83 commit 5ea834b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/iscsi/iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5ea834b

Please sign in to comment.