OSDN Git Service

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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 12 Feb 2018 16:43:23 +0000 (11:43 -0500)
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>
drivers/scsi/lpfc/lpfc_attr.c

index 06138b6..e25e63e 100644 (file)
@@ -911,7 +911,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;