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: Jim 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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Jim Harris 2019-04-05 05:09:43 -07:00 committed by Darek Stojaczyk
parent e862b6434a
commit 7b266460d0

View File

@ -3315,12 +3315,12 @@ _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) {
TAILQ_REMOVE(&conn->queued_datain_tasks, task, link);
return 0;
}
/* Remove the primary task from the list if this is the last subtask */
if (task->current_datain_offset == task->scsi.transfer_len) {
TAILQ_REMOVE(&conn->queued_datain_tasks, task, link);
return 0;
}
}