From 99c229470c84fe21d6b02dec6a00d7fe4075bc94 Mon Sep 17 00:00:00 2001 From: James Smart Date: Wed, 12 Jul 2017 18:49:17 -0400 Subject: [PATCH] scsi: lpfc: Fix Port going offline after [backport of f4af07d4df21c5d02f66a0174b9669187a40bf1e] From: rkennedy Orabug: 26439257 Observing lpfc port down after issuing hbacmd reset command Failure in posting SGL buffers. If there is only one SGL buffer and rrq is valid for its XRI, we are rightly returning NULL but not adding the buffer back to the SGL list. So, number of buffers become less than total count and repost fails during reset. Add SGL buffer back to list before returning NULL. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Brian Maly --- drivers/scsi/lpfc/lpfc_sli.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 09a012edea9e..2fcc8a9a3fbb 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -952,6 +952,7 @@ __lpfc_sli_get_sglq(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq) list_remove_head(lpfc_sgl_list, sglq, struct lpfc_sglq, list); if (sglq == start_sglq) { + list_add_tail(&sglq->list, lpfc_sgl_list); sglq = NULL; break; } else -- 2.50.1