]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ibmvfc: Fix up duplicate response detection
authorBrian King <brking@linux.vnet.ibm.com>
Tue, 19 Oct 2021 15:21:29 +0000 (10:21 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 21 Oct 2021 02:59:45 +0000 (22:59 -0400)
commit25bccc079414ed3110a6979f178c5bafdd312870
treeee81de16eaa282773dd57ff76a9bcd2ede245ff8
parentbbe6e0941a9c66f52d8e65304d4c37a77eda6107
scsi: ibmvfc: Fix up duplicate response detection

Commit 6e2ee6bd4ab1 ("scsi: ibmvfc: Fix command state accounting and stale
response detection") introduced a regression in detecting duplicate
responses. This was observed in test where a command was sent to the VIOS
and completed before ibmvfc_send_event() set the active flag to 1, which
resulted in the atomic_dec_if_positive() call in ibmvfc_handle_crq()
thinking this was a duplicate response, which resulted in scsi_done() not
getting called, so we then hit a SCSI command timeout for this command once
the timeout expires.  This simply ensures the active flag gets set prior to
making the hcall to send the command to the VIOS, in order to close this
window.

Link: https://lore.kernel.org/r/20211019152129.16558-1-brking@linux.vnet.ibm.com
Fixes: 6e2ee6bd4ab1 ("scsi: ibmvfc: Fix command state accounting and stale response detection")
Cc: stable@vger.kernel.org
Acked-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi/ibmvfc.c