[lkml]   [2012]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH UPDATED] block: In blk_execute_rq_nowait, init rq->end_io before checking for dead queue.
    Since the queue->lock case is taken care of in the following patch:

    ( [PATCH 1/4]
    block: Fix race on request_queue.end_io invocations)

    Updated the patch with just the end_io assignment before dead queue check.

    blk-exec.c: In blk_execute_rq_nowait(), if the queue is dead, call to
    done() routine is not made. That will result in blk_execute_rq() stuck
    in wait_for_completion(). Avoid this by initializing rq->end_io to
    done() routine before we check for dead queue.

    Signed-off-by: Muthukumar Ratty <>
    CC: Tejun Heo <>
    CC: Jens Axboe <>
    CC: James Bottomley <>

    diff --git a/block/blk-exec.c b/block/blk-exec.c
    index fb2cbd5..f8b00c7 100644
    --- a/block/blk-exec.c
    +++ b/block/blk-exec.c
    @@ -53,6 +53,9 @@ void blk_execute_rq_nowait(struct request_queue *q,
    struct gendisk *bd_disk,

    + rq->rq_disk = bd_disk;
    + rq->end_io = done;
    if (unlikely(blk_queue_dead(q))) {
    rq->errors = -ENXIO;
    @@ -61,8 +64,6 @@ void blk_execute_rq_nowait(struct request_queue *q,
    struct gendisk *bd_disk,
    [unhandled content-type:application/octet-stream]
     \ /
      Last update: 2012-06-09 03:01    [W:0.021 / U:22.676 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site