Bart Van Assche 978b7922d3 scsi: core: Fix a race between scsi_done() and scsi_timeout()
If there is a race between scsi_done() and scsi_timeout() and if
scsi_timeout() loses the race, scsi_timeout() should not reset the request
timer. Hence change the return value for this case from BLK_EH_RESET_TIMER
into BLK_EH_DONE.

Although the block layer holds a reference on a request (req->ref) while
calling a timeout handler, restarting the timer (blk_add_timer()) while a
request is being completed is racy.

Reviewed-by: Mike Christie <michael.christie@oracle.com>
Cc: Keith Busch <kbusch@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Hannes Reinecke <hare@suse.de>
Reported-by: Adrian Hunter <adrian.hunter@intel.com>
Fixes: 15f73f5b3e59 ("blk-mq: move failure injection out of blk_mq_complete_request")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221018202958.1902564-2-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-10-22 03:25:59 +00:00
..
2022-08-04 19:47:37 -07:00
2022-08-04 19:47:37 -07:00
2022-05-23 23:24:10 -04:00
2022-10-07 12:33:18 -07:00
2022-10-07 12:33:18 -07:00
2022-10-07 12:33:18 -07:00
2022-10-07 12:33:18 -07:00
2022-08-04 19:47:37 -07:00
2022-02-22 21:11:02 -05:00
2022-07-26 22:13:29 -04:00
2022-02-22 21:11:02 -05:00
2022-06-27 22:56:21 -04:00
2022-01-25 00:09:41 -05:00
2022-02-22 21:11:02 -05:00
2022-09-01 01:02:10 -04:00
2022-05-08 14:28:18 -04:00
2022-09-30 07:51:13 -06:00
2021-12-22 23:41:13 -05:00
2022-06-28 06:30:26 -06:00
2022-10-07 12:33:18 -07:00
2022-10-10 13:59:01 -07:00
2022-10-07 12:33:18 -07:00