scsi: iscsi: Fix completion check during abort races

We have a ref to the task being aborted, so SCp.ptr will never be NULL. We
need to use iscsi_task_is_completed to check for the completed state.

Link: https://lore.kernel.org/r/20210525181821.7617-16-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Mike Christie 2021-05-25 13:18:08 -05:00 коммит произвёл Martin K. Petersen
Родитель bdd4aad7ff
Коммит f6f9645744
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -2338,7 +2338,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
goto failed_unlocked; goto failed_unlocked;
case TMF_NOT_FOUND: case TMF_NOT_FOUND:
if (!sc->SCp.ptr) { if (iscsi_task_is_completed(task)) {
session->tmf_state = TMF_INITIAL; session->tmf_state = TMF_INITIAL;
memset(hdr, 0, sizeof(*hdr)); memset(hdr, 0, sizeof(*hdr));
/* task completed before tmf abort response */ /* task completed before tmf abort response */