Signed-off-by: Hannes Reinecke <[email protected]>
---
 drivers/scsi/lpfc/lpfc_init.c | 1 +
 drivers/scsi/lpfc/lpfc_scsi.c | 3 +++
 drivers/scsi/lpfc/lpfc_scsi.h | 1 +
 3 files changed, 5 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index b43f7ac..d2a6302 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1028,6 +1028,7 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba)
        spin_unlock_irq(&phba->hbalock);
 
        list_for_each_entry_safe(psb, psb_next, &aborts, list) {
+               clear_bit(LPFC_CMD_ABORTED, &psb->flags);
                psb->pCmd = NULL;
                psb->status = IOSTAT_SUCCESS;
        }
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 4354713..3111a9d 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -556,6 +556,7 @@ lpfc_sli4_fcp_xri_aborted(struct lpfc_hba *phba,
                &phba->sli4_hba.lpfc_abts_scsi_buf_list, list) {
                if (psb->cur_iocbq.sli4_xritag == xri) {
                        list_del(&psb->list);
+                       clear_bit(LPFC_CMD_ABORTED, &psb->flags);
                        clear_bit(LPFC_CMD_EXCH_BUSY, &psb->flags);
                        psb->status = IOSTAT_SUCCESS;
                        spin_unlock(
@@ -1092,6 +1093,8 @@ lpfc_release_scsi_buf_s4(struct lpfc_hba *phba, struct 
lpfc_scsi_buf *psb)
        psb->prot_seg_cnt = 0;
 
        if (test_bit(LPFC_CMD_EXCH_BUSY, &psb->flags)) {
+               if (!test_and_set_bit(LPFC_CMD_ABORTED, &psb->flags))
+                       return;
                spin_lock_irqsave(&phba->sli4_hba.abts_scsi_buf_list_lock,
                                        iflag);
                psb->pCmd = NULL;
diff --git a/drivers/scsi/lpfc/lpfc_scsi.h b/drivers/scsi/lpfc/lpfc_scsi.h
index a3658ce..4e8f0bd 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.h
+++ b/drivers/scsi/lpfc/lpfc_scsi.h
@@ -145,6 +145,7 @@ struct lpfc_scsi_buf {
 
        unsigned long flags;
 #define LPFC_CMD_EXCH_BUSY 1
+#define LPFC_CMD_ABORTED   2
        dma_addr_t nonsg_phys;  /* Non scatter-gather physical address. */
 
        /*
-- 
1.8.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to