diff options
authorTejun Heo <>2018-04-02 15:04:58 -0700
committerJens Axboe <>2018-04-02 16:36:13 -0600
commitbc6d65e6dc89c3b7ff78e4ad797117c122ffde8e (patch)
parenta5040c2d8dd732252609cde84ee3cdd6f1b1f927 (diff)
blk-mq: Directly schedule q->timeout_work when aborting a requestfor-4.17/block-20180402for-4.17/block
Request abortion is performed by overriding deadline to now and scheduling timeout handling immediately. For the latter part, the code was using mod_timer(timeout, 0) which can't guarantee that the timer runs afterwards. Let's schedule the underlying work item directly instead. This fixes the hangs during probing reported by Sitsofe but it isn't yet clear to me how the failure can happen reliably if it's just the above described race condition. Signed-off-by: Tejun Heo <> Reported-by: Sitsofe Wheeler <> Reported-by: Meelis Roos <> Fixes: 358f70da49d7 ("blk-mq: make blk_abort_request() trigger timeout path") Cc: # v4.16 Link: Link: Signed-off-by: Jens Axboe <>
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 34a55250f08a..652d4d4d3e97 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -163,7 +163,7 @@ void blk_abort_request(struct request *req)
* No need for fancy synchronizations.
blk_rq_set_deadline(req, jiffies);
- mod_timer(&req->q->timeout, 0);
+ kblockd_schedule_work(&req->q->timeout_work);
} else {
if (blk_mark_rq_complete(req))