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 <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic1603609f760c4bdd41272ba6146e260f668b059
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475043
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-11-19 15:22:42 +09:00 committed by Tomasz Zawadzki
parent 0e39681d17
commit 8238265548

View File

@ -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);