scsi: lpfc: Correct LCB RJT handling
authorJames Smart <jsmart2021@gmail.com>
Tue, 23 Oct 2018 20:41:07 +0000 (13:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:44:51 +0000 (19:44 +0100)
[ Upstream commit b114d9009d386276bfc3352289fc235781ae3353 ]

When LCB's are rejected, if beaconing was already in progress, the
Reason Code Explanation was not being set. Should have been set to
command in progress.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_els.c

index fc7addaf24da24760cb40fca30cb2308a104e60a..4905455bbfc7515f5705a42d4a071d3aa686fe3e 100644 (file)
@@ -5396,6 +5396,9 @@ error:
        stat = (struct ls_rjt *)(pcmd + sizeof(uint32_t));
        stat->un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
 
+       if (shdr_add_status == ADD_STATUS_OPERATION_ALREADY_ACTIVE)
+               stat->un.b.lsRjtRsnCodeExp = LSEXP_CMD_IN_PROGRESS;
+
        elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
        phba->fc_stat.elsXmitLSRJT++;
        rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);