]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: core: Only return started requests from scsi_host_find_tag()
authorHannes Reinecke <hare@suse.de>
Mon, 22 Jun 2020 06:30:22 +0000 (08:30 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 25 Jul 2020 02:09:56 +0000 (22:09 -0400)
commit939c5773cab233c85f4dbf9a2bd2185efff235c8
treee1004097b9ba3c79626fc56439b3136427d4c6ce
parentdec3cd84243d501b0cad4b2bd8ff8ea7c109dfaf
scsi: core: Only return started requests from scsi_host_find_tag()

scsi_host_find_tag() is used by the drivers to return a scsi command based
on the command tag. Typically it's used from the interrupt handler to fetch
the command associated with a value returned from hardware. Some drivers
like fnic or qla4xxx, however, also use it also to traverse outstanding
commands.  With the current implementation scsi_host_find_tag() will return
commands even if they are not started (i.e. passed to the driver).  This
will result in random errors with those drivers.  With this patch
scsi_host_find_tag() will only return 'started' commands (i.e. commands
which have been passed to the drivers) thus avoiding the above issue.  The
other use cases will be unaffected as the interrupt handler naturally will
only ever return 'started' requests.

Link: https://lore.kernel.org/r/20200622063022.67891-1-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/scsi/scsi_tcq.h