lkml.org 
[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC:blk-exec-call-completion-if-queue-dead [was Q: blk_execute_rq_nowait() doesn't call completion in case of dead queue
On Wed, Jun 06, 2012 at 02:24:35PM -0700, Muthu Kumar wrote:
> How about this change?
>
> diff --git a/block/blk-exec.c b/block/blk-exec.c
> index fb2cbd5..6bf5c0b 100644
> --- a/block/blk-exec.c
> +++ b/block/blk-exec.c
> @@ -56,8 +56,10 @@ void blk_execute_rq_nowait(struct request_queue *q, struct ge
> if (unlikely(blk_queue_dead(q))) {
> spin_unlock_irq(q->queue_lock);
> rq->errors = -ENXIO;
> - if (rq->end_io)
> - rq->end_io(rq, rq->errors);
> + if (done)
> + done(rq, rq->errors);
> + else if (rq->end_io) //XXX Not sure if this check and end_io
> + rq->end_io(rq, rq->errors);
> return;
> }
>
> Only one driver - sx8.c, doesn't set done() function and every one
> else expects done() to be called with error.

Looks like the bug there is rq->rq_disk and rq->end_io assignments
happening after the queue_dead check. Just move the two lines before
queue_head check?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-06-07 05:21    [W:0.048 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site