From 8238265548c27bbaf460ed6ccafbbbb8f61e9f7a Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 19 Nov 2019 15:22:42 +0900 Subject: [PATCH] lib/iscsi: Separate split and non-split in process_non_read_task_completion() In process_non_read_task_completion(), when the current I/O is not split, we have to call only spdk_iscsi_task_response(). The next patch will fix the github issue by changing the path executed when the current I/O is split. Hence to make the fix easier, this patch separates split case and non-split case. Signed-off-by: Shuhei Matsumoto Change-Id: Ic1603609f760c4bdd41272ba6146e260f668b059 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475043 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/iscsi/conn.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index a63e4355c..3732537e6 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -1081,11 +1081,6 @@ process_non_read_task_completion(struct spdk_iscsi_conn *conn, } if (primary->bytes_completed == primary->scsi.transfer_len) { - spdk_del_transfer_task(conn, primary->tag); - if (primary->rsp_scsi_status != SPDK_SCSI_STATUS_GOOD) { - iscsi_task_copy_from_rsp_scsi_status(&primary->scsi, primary); - } - spdk_iscsi_task_response(conn, primary); /* * Check if this is the last task completed for an iSCSI write * that required child subtasks. If task != primary, we know @@ -1095,8 +1090,15 @@ process_non_read_task_completion(struct spdk_iscsi_conn *conn, * the overall transfer length. */ if (task != primary || task->scsi.length != task->scsi.transfer_len) { + spdk_del_transfer_task(conn, primary->tag); + if (primary->rsp_scsi_status != SPDK_SCSI_STATUS_GOOD) { + iscsi_task_copy_from_rsp_scsi_status(&primary->scsi, primary); + } + spdk_iscsi_task_response(conn, primary); TAILQ_REMOVE(&conn->active_r2t_tasks, primary, link); spdk_iscsi_task_put(primary); + } else { + spdk_iscsi_task_response(conn, task); } } spdk_iscsi_task_put(task);