Commit cd945076 authored by Cunyin Chang's avatar Cunyin Chang Committed by Daniel Verkamp
Browse files

iscsi: Handle the error case for large IO read.



There is one scenario, when one large read IO is splitted into several
subtasks 1 - N, and the subtask N return successful, it will be stored
in the subtask_list of primary task, but the other tasks could return
error, then when we try to return the subtask N, it will failed, this patch
will make sure the large read IO command return correctly if any of the
subtasks failed.

Change-Id: Ie6bcb79a081acf30f4e4c177c0f7568495ff2b71
Signed-off-by: default avatarCunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/373450


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent a171aba8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -992,6 +992,15 @@ process_read_task_completion(struct spdk_iscsi_conn *conn,
	struct spdk_iscsi_task *tmp;
	bool flag = false;

	if (task->scsi.status != SPDK_SCSI_STATUS_GOOD) {
		TAILQ_FOREACH(tmp, &primary->subtask_list, subtask_link) {
			memcpy(tmp->scsi.sense_data, task->scsi.sense_data,
			       task->scsi.sense_data_len);
			tmp->scsi.sense_data_len = task->scsi.sense_data_len;
			tmp->scsi.status = task->scsi.status;
		}
	}

	if ((task != primary) &&
	    (task->scsi.offset != primary->bytes_completed)) {
		TAILQ_FOREACH(tmp, &primary->subtask_list, subtask_link) {