Commit eb6bac0a authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Darek Stojaczyk
Browse files

iscsi: Fix the issue caused by cleanup LUNs when exiting connection



When exiting connection, all active tasks are aborted by
spdk_iscsi_tgt_node_cleanup() in lib/iscsi/tgt_node.c.

In spdk_iscsi_tgt_node_cleanup(), spdk_iscsi_op_abort_task_set()
is called by using a temporary task without associating PDU.

This call of spdk_iscsi_op_abort_task_set() have resulted in
assertion in spdk_iscsi_conn_abort_queued_datain_tasks() because
task->pdu is NULL.

The fix is to remove the assertion in
spdk_iscsi_conn_abort_queued_datain_tasks() and add check if
pdu == NULL as true condition.

This issue was detected by ip_migration test. ip_migration test
runs only in nightly tests now but it consumes only 26 seconds,
and the next patch moves ip_migration test to per-patch tests.

Fixes #544

Change-Id: I7719ad57d22c4354530adabfcdc5a818c804b841
Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/438223


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 0bf22fb8
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -3228,12 +3228,10 @@ spdk_iscsi_conn_abort_queued_datain_tasks(struct spdk_iscsi_conn *conn,
	struct spdk_iscsi_pdu *pdu_tmp;
	int rc;

	assert(pdu != NULL);

	TAILQ_FOREACH_SAFE(task, &conn->queued_datain_tasks, link, task_tmp) {
		pdu_tmp = spdk_iscsi_task_get_pdu(task);
		if ((lun == NULL || lun == task->scsi.lun) &&
		    (SN32_LT(pdu_tmp->cmd_sn, pdu->cmd_sn))) {
		    (pdu == NULL || (SN32_LT(pdu_tmp->cmd_sn, pdu->cmd_sn)))) {
			rc = _spdk_iscsi_conn_abort_queued_datain_task(conn, task);
			if (rc != 0) {
				return rc;