scsi: lpfc: Fix issue_lip if link is disabled
authorJames Smart <jsmart2021@gmail.com>
Tue, 30 Jan 2018 23:58:55 +0000 (15:58 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:50 +0000 (16:17 +0200)
[ Upstream commit 2289e9598dde9705400559ca2606fb8c145c34f0 ]

The driver ignored checks on whether the link should be kept
administratively down after a link bounce. Correct the checks.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/lpfc/lpfc_attr.c

index dc6519b2c53ad48ed419062a2cefb35d2db6be65..3da242201cb4584b51370a0f43bd7801c8eed0cc 100644 (file)
@@ -871,7 +871,12 @@ lpfc_issue_lip(struct Scsi_Host *shost)
        LPFC_MBOXQ_t *pmboxq;
        int mbxstatus = MBXERR_ERROR;
 
+       /*
+        * If the link is offline, disabled or BLOCK_MGMT_IO
+        * it doesn't make any sense to allow issue_lip
+        */
        if ((vport->fc_flag & FC_OFFLINE_MODE) ||
+           (phba->hba_flag & LINK_DISABLED) ||
            (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO))
                return -EPERM;