]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed
authorWenchao Hao <haowenchao2@huawei.com>
Mon, 15 May 2023 07:01:56 +0000 (15:01 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 4 Sep 2023 09:10:28 +0000 (11:10 +0200)
commit4cab556c987bd0eb5e8e25a8823f70bbf50caeee
tree8c1904b28931443b428246a51a60bd00f28cc331
parent0190b372e578b2c96aecef0b754911d3d77349e6
scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed

BugLink: https://bugs.launchpad.net/bugs/2029808
[ Upstream commit 09e797c8641f6ad435c33ae24c223351197ea29a ]

If scsi_dispatch_cmd() failed, the SCSI command was not sent to the target,
scsi_queue_rq() would return BLK_STS_RESOURCE and the related request would
be requeued. The timeout of this request would not fire, no one would
increase iodone_cnt.

The above flow would result the iodone_cnt smaller than iorequest_cnt.  So
decrease the iorequest_cnt if dispatch failed to workaround the issue.

Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
Reported-by: Ming Lei <ming.lei@redhat.com>
Closes: https://lore.kernel.org/r/ZF+zB+bB7iqe0wGd@ovpn-8-17.pek2.redhat.com
Link: https://lore.kernel.org/r/20230515070156.1790181-3-haowenchao2@huawei.com
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/scsi_lib.c