Skip to content

Commit 5e940aa

Browse files
Ming Leiaxboe
authored andcommitted
blk-timeout: fix blk_add_timer
Commit 8cb3481(blk-mq: unshared timeout handler) introduces blk-mq's own timeout handler, and removes following line: blk_queue_rq_timed_out(q, blk_mq_rq_timed_out); which then causes blk_add_timer() to bypass adding the timer, since blk-mq no longer has q->rq_timed_out_fn defined. This patch fixes the problem by bypassing the check for blk-mq, so that both request deadlines are still set and the rolling timer updated. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent aedcd72 commit 5e940aa

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎block/blk-timeout.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ void blk_add_timer(struct request *req)
186186
struct request_queue *q = req->q;
187187
unsigned long expiry;
188188

189-
if (!q->rq_timed_out_fn)
189+
/* blk-mq has its own handler, so we don't need ->rq_timed_out_fn */
190+
if (!q->mq_ops && !q->rq_timed_out_fn)
190191
return;
191192

192193
BUG_ON(!list_empty(&req->timeout_list));

0 commit comments

Comments
 (0)