]> asedeno.scripts.mit.edu Git - linux.git/commit
scsi: lpfc: Fix list corruption on the completion queue.
authorJames Smart <jsmart2021@gmail.com>
Wed, 1 Aug 2018 00:23:20 +0000 (17:23 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 2 Aug 2018 19:45:18 +0000 (15:45 -0400)
commit8931c73bee077f5bc5710afebc0136363970cb2b
tree106e6fe2749de6ac878a76e6493c3f4f00ed17d2
parentb615a20adf04cf3c8e9293851da3aac54792fb07
scsi: lpfc: Fix list corruption on the completion queue.

Enabling list_debug showed the drivers txcmplq was suffering list
corruption. The systems will eventually crash because the iocb free list
gets crossed linked with the prings txcmplq.  Most systems will run for a
while after the corruption, but will eventually crash when a scsi eh reset
occurs and the txcmplq is attempted to be flushed. The flush gets stuck in
an endless loop.

The problem is the abort handler does not hold the sli4 ring lock while
validating the IO so the IO could complete while the driver is still
preping the abort.  The erroneously generated abort, when it completes, has
pointers to the original IO that has already completed, and the IO
manipulation (for the second time) corrupts the list.

Correct by taking the ring lock early in the abort handler so the erroneous
abort won't be sent if the io has/is completing.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_scsi.c