All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>, Jiri Slaby <jslaby@suse.cz>,
	"James E.J. Bottomley" <jejb@parisc-linux.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Jiri Slaby <jirislaby@gmail.com>
Subject: Re: [PATCH block/for-next] block: don't call blk_drain_queue() if elevator is not up
Date: Fri, 4 Nov 2011 10:40:42 +0100	[thread overview]
Message-ID: <20111104104042.46a33554@stein> (raw)
In-Reply-To: <20111103162634.GK4417@google.com>

On Nov 03 Tejun Heo wrote:
> blk_cleanup_queue() may be called before elevator is set up on a
> queue which triggers the following oops.
[...]
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -407,8 +407,13 @@ void blk_cleanup_queue(struct request_queue *q)
>  	spin_unlock_irq(lock);
>  	mutex_unlock(&q->sysfs_lock);
>  
> -	/* drain all requests queued before DEAD marking */
> -	blk_drain_queue(q, true);
> +	/*
> +	 * Drain all requests queued before DEAD marking.  The caller might
> +	 * be trying to tear down @q before its elevator is initialized, in
> +	 * which case we don't want to call into draining.
> +	 */
> +	if (q->elevator)
> +		blk_drain_queue(q, true);
>  
>  	/* @q won't process any more request, flush async actions */
>  	del_timer_sync(&q->backing_dev_info.laptop_mode_wb_timer);

What prevents elevator_attach to be called and requests to be inserted
between 'if (q-elevator)' and 'blk_put_queue(q)'?
-- 
Stefan Richter
-=====-==-== =-== --=--
http://arcgraph.de/sr/

  parent reply	other threads:[~2011-11-04  9:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 16:08 NULL ptr deref at elv_drain_elevator Jiri Slaby
2011-11-03 16:14 ` Tejun Heo
2011-11-03 16:16   ` Jiri Slaby
2011-11-03 16:26   ` [PATCH block/for-next] block: don't call blk_drain_queue() if elevator is not up Tejun Heo
2011-11-03 17:49     ` Jens Axboe
2011-11-03 21:12       ` Tejun Heo
2011-11-04  8:12         ` Jens Axboe
2011-11-04 14:26           ` Tejun Heo
2011-11-04 14:28             ` Jens Axboe
2011-11-04 14:30               ` Tejun Heo
2011-11-04  9:40     ` Stefan Richter [this message]
2011-11-04 14:38       ` Tejun Heo

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=20111104104042.46a33554@stein \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=axboe@kernel.dk \
    --cc=jejb@parisc-linux.org \
    --cc=jirislaby@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.