Skip to content

Commit bc6d65e

Browse files
htejunaxboe
authored andcommitted
blk-mq: Directly schedule q->timeout_work when aborting a request
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 <tj@kernel.org> Reported-by: Sitsofe Wheeler <sitsofe@gmail.com> Reported-by: Meelis Roos <mroos@linux.ee> Fixes: 358f70d ("blk-mq: make blk_abort_request() trigger timeout path") Cc: stable@vger.kernel.org # v4.16 Link: http://lkml.kernel.org/r/CALjAwxh-PVYFnYFCJpGOja+m5SzZ8Sa4J7ohxdK=r8NyOF-EMA@mail.gmail.com Link: http://lkml.kernel.org/r/alpine.LRH.2.21.1802261049140.4893@math.ut.ee Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a5040c2 commit bc6d65e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎block/blk-timeout.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void blk_abort_request(struct request *req)
163163
* No need for fancy synchronizations.
164164
*/
165165
blk_rq_set_deadline(req, jiffies);
166-
mod_timer(&req->q->timeout, 0);
166+
kblockd_schedule_work(&req->q->timeout_work);
167167
} else {
168168
if (blk_mark_rq_complete(req))
169169
return;

0 commit comments

Comments
 (0)