Commit 7b266460 authored by Jim Harris's avatar Jim Harris Committed by Darek Stojaczyk
Browse files

iscsi: handle aborts for queued_datain_task that is completed



It's possible that we get a request to abort I/O just after
a queued_datain_task has completed, but before we've had a
chance to remove it from the queued_datain_tasks TAILQ.
_iscsi_conn_abort_queued_datain_task wasn't accounting for
that which would result in an infinite loop.

Fixes issue #725.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: Jane Lusby
Change-Id: I494ee78763d527d83dcb65f46563ee69bb975576

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450301


Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent e862b643
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -3315,6 +3315,7 @@ _iscsi_conn_abort_queued_datain_task(struct spdk_iscsi_conn *conn,
			subtask->scsi.transfer_len = subtask->scsi.length;
			spdk_scsi_task_process_abort(&subtask->scsi);
			spdk_iscsi_task_cpl(&subtask->scsi);
		}

		/* Remove the primary task from the list if this is the last subtask */
		if (task->current_datain_offset == task->scsi.transfer_len) {
@@ -3322,7 +3323,6 @@ _iscsi_conn_abort_queued_datain_task(struct spdk_iscsi_conn *conn,
			return 0;
		}
	}
	}

	return -1;
}