lkml.org 
[lkml]   [2012]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    SubjectRe: [PATCH UPDATED] block: In blk_execute_rq_nowait, init rq->end_io before checking for dead queue.
    From
    On Sat, Jun 9, 2012 at 5:47 AM, Bart Van Assche <bvanassche@acm.org> wrote:
    > On 06/09/12 00:10, Muthu Kumar wrote:
    >
    >> Since the queue->lock case is taken care of in the following patch:
    >>
    >> (http://www.spinics.net/lists/linux-scsi/msg59845.html [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.
    >>
    >>
    >
    >
    > This patch does not apply since it's line-wrapped and a part is missing
    > in the second hunk. However, if I had overlooked your original patch
    > then I want to apologize.
    >

    Please use the attached file since gmail messes with the line wraps.

    > If you can resend your original patch including the locking changes then
    > I'll test it further.
    >

    Locking change is the one you posted already (the link above). Anyway,
    I have the attached patch *including* the locking change. Original
    mail has attachment without locking change. Please use whatever you
    need.
    Thanks for testing.

    Regards,
    Muthu


    > Bart.
    diff --git a/block/blk-exec.c b/block/blk-exec.c
    index fb2cbd5..284bf56 100644
    --- a/block/blk-exec.c
    +++ b/block/blk-exec.c
    @@ -53,16 +53,17 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
    WARN_ON(irqs_disabled());
    spin_lock_irq(q->queue_lock);

    + rq->rq_disk = bd_disk;
    + rq->end_io = done;
    +
    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);
    + spin_unlock_irq(q->queue_lock);
    return;
    }

    - rq->rq_disk = bd_disk;
    - rq->end_io = done;
    __elv_add_request(q, rq, where);
    __blk_run_queue(q);
    /* the queue is stopped so it won't be run */
    \
     
     \ /
      Last update: 2012-06-10 02:21    [W:0.025 / U:88.700 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site