public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-timeout: fix blk_add_timer
@ 2014-09-19 13:53 Ming Lei
  2014-09-19 14:12 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2014-09-19 13:53 UTC (permalink / raw)
  To: linux-kernel, Christoph Hellwig; +Cc: Jens Axboe, Ming Lei

Commit 8cb34819cdd5d(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);

then cause blk_add_timer() to do nop in case of blk-mq.

This patch fixes the problem by bypassing the check for blk-mq.

Signe-off-by: Ming Lei <ming.lei@canonical.com>
---
 block/blk-timeout.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 4d44825..0c2375c 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -186,7 +186,8 @@ void blk_add_timer(struct request *req)
 	struct request_queue *q = req->q;
 	unsigned long expiry;
 
-	if (!q->rq_timed_out_fn)
+	/* mq needn't the handler */
+	if (!q->mq_ops && !q->rq_timed_out_fn)
 		return;
 
 	BUG_ON(!list_empty(&req->timeout_list));
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] blk-timeout: fix blk_add_timer
  2014-09-19 13:53 [PATCH] blk-timeout: fix blk_add_timer Ming Lei
@ 2014-09-19 14:12 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2014-09-19 14:12 UTC (permalink / raw)
  To: Ming Lei, linux-kernel, Christoph Hellwig

On 09/19/2014 07:53 AM, Ming Lei wrote:
> Commit 8cb34819cdd5d(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);
> 
> then cause blk_add_timer() to do nop in case of blk-mq.
> 
> This patch fixes the problem by bypassing the check for blk-mq.

Good catch, this explains something I ran into yesterday on a missing
timer. I had a hard time understanding your description here, I'll
reword it a little bit and apply. Thanks!

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-19 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-19 13:53 [PATCH] blk-timeout: fix blk_add_timer Ming Lei
2014-09-19 14:12 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox