diff --git a/[refs] b/[refs] index 95b158b2b6db..b3317524be73 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e340c3537239d5b6a2b21d4245c8577d457b0476 +refs/heads/master: a1e0063d0c015145946981262f8d5f9758d8a895 diff --git a/trunk/drivers/scsi/qla4xxx/ql4_os.c b/trunk/drivers/scsi/qla4xxx/ql4_os.c index f1c58eb26ba2..f4cd846abf6d 100644 --- a/trunk/drivers/scsi/qla4xxx/ql4_os.c +++ b/trunk/drivers/scsi/qla4xxx/ql4_os.c @@ -881,7 +881,13 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha) /* Find a command that hasn't completed. */ for (index = 0; index < ha->host->can_queue; index++) { cmd = scsi_host_find_tag(ha->host, index); - if (cmd != NULL) + /* + * We cannot just check if the index is valid, + * becase if we are run from the scsi eh, then + * the scsi/block layer is going to prevent + * the tag from being released. + */ + if (cmd != NULL && CMD_SP(cmd)) break; } spin_unlock_irqrestore(&ha->hardware_lock, flags);