scsi: fnic: Replace sgreset tag with max_tag_id
authorKaran Tilak Kumar <kartilak@cisco.com>
Thu, 17 Aug 2023 18:21:46 +0000 (11:21 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2023 21:15:09 +0000 (17:15 -0400)
commit15924b0503630016dee4dbb945a8df4df659070b
treea23dcbed97bfb274091c5d1cbabacbd5825504e0
parent530e86c745ae3342b1df5e8f38529b9f8a6cac17
scsi: fnic: Replace sgreset tag with max_tag_id

sgreset is issued with a SCSI command pointer. The device reset code
assumes that it was issued on a hardware queue, and calls block multiqueue
layer. However, the assumption is broken, and there is no hardware queue
associated with the sgreset, and this leads to a crash due to a null
pointer exception.

Fix the code to use the max_tag_id as a tag which does not overlap with the
other tags issued by mid layer.

Tested by running FC traffic for a few minutes, and by issuing sgreset on
the device in parallel.  Without the fix, the crash is observed right away.
With this fix, no crash is observed.

Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
Tested-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
Link: https://lore.kernel.org/r/20230817182146.229059-1-kartilak@cisco.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fnic/fnic.h
drivers/scsi/fnic/fnic_scsi.c