lkml.org 
[lkml]   [2011]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH block/for-next] block: don't call blk_drain_queue() if elevator is not up
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/


\
 
 \ /
  Last update: 2011-11-04 10:45    [W:0.068 / U:1.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site