Commit 82382655 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic1603609f760c4bdd41272ba6146e260f668b059
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475043


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 0e39681d
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -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);