The tasks's sc is cleared when it's going to be sent back to scsi-ml. This is done under the back block in __iscsi_free_task, so we must set and check this under the same lock. Signed-off-by: Mike Christie <michael.christie@xxxxxxxxxx> --- drivers/scsi/be2iscsi/be_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 99eae2add8da..4181769d7303 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -216,12 +216,12 @@ static char const *cqe_desc[] = { static int beiscsi_eh_abort(struct scsi_cmnd *sc) { - struct iscsi_task *abrt_task = (struct iscsi_task *)sc->SCp.ptr; struct iscsi_cls_session *cls_session; struct beiscsi_io_task *abrt_io_task; struct beiscsi_conn *beiscsi_conn; struct iscsi_session *session; struct invldt_cmd_tbl inv_tbl; + struct iscsi_task *abrt_task; struct beiscsi_hba *phba; struct iscsi_conn *conn; int rc; @@ -231,7 +231,8 @@ static int beiscsi_eh_abort(struct scsi_cmnd *sc) /* check if we raced, task just got cleaned up under us */ spin_lock_bh(&session->back_lock); - if (!abrt_task || !abrt_task->sc) { + abrt_task = scsi_cmd_priv(sc); + if (!abrt_task->sc) { spin_unlock_bh(&session->back_lock); return SUCCESS; } -- 2.25.1