public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Muthu Kumar <muthu.lkml@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	James.Bottomley@hansenpartnership.com,
	linux-kernel@vger.kernel.org
Subject: Re: RFC:blk-exec-call-completion-if-queue-dead [was Q: blk_execute_rq_nowait() doesn't call completion in case of dead queue
Date: Thu, 7 Jun 2012 11:40:22 +0900	[thread overview]
Message-ID: <20120607024022.GI21357@google.com> (raw)
In-Reply-To: <CAFR8uefaH_MzjfkPTY1+D5yav8cawtOS7NKyexzRG318Bris1w@mail.gmail.com>

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

      reply	other threads:[~2012-06-07  2:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 21:24 RFC:blk-exec-call-completion-if-queue-dead [was Q: blk_execute_rq_nowait() doesn't call completion in case of dead queue Muthu Kumar
2012-06-07  2:40 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120607024022.GI21357@google.com \
    --to=tj@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muthu.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox