2012-06-06 18:59:10

by Muthu Kumar

[permalink] [raw]
Subject: Q: blk_execute_rq_nowait() doesn't call completion in case of dead queue

Jens, Tejun et al,
blk_execute_rq() calls blk_execute_rq_nowait() with blk_end_sync_rq()
as the completion (done) routine. And then waits for the completion().


rq->end_io_data = &wait;
blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq);
...
...
wait_for_completion(&wait)

But in blk_execute_rq_nowait() if the queue is dead, completion
routine is not called. Shouldn't we have to call the above completion
(done()) to wake up the wait_for_completion()?


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);
return;
}

Thanks.

Regards,
Muthu