Skip to content

Commit

Permalink
[PATCH] blk_start_queue() must be called with irq disabled - add warning
Browse files Browse the repository at this point in the history
The queue lock can be taken from interrupts so it must always be taken with
irq disabling primitives.  Some primitives already verify this.
blk_start_queue() is called under this lock, so interrupts must be
disabled.

Also document this requirement clearly in blk_init_queue(), where the queue
spinlock is set.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jens Axboe <axboe@suse.de>
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Jens Axboe committed Jun 23, 2006
1 parent bae386f commit a038e25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,8 @@ static void blk_unplug_timeout(unsigned long data)
**/
void blk_start_queue(request_queue_t *q)
{
WARN_ON(!irqs_disabled());

clear_bit(QUEUE_FLAG_STOPPED, &q->queue_flags);

/*
Expand Down Expand Up @@ -1878,7 +1880,8 @@ EXPORT_SYMBOL(blk_alloc_queue_node);
* get dealt with eventually.
*
* The queue spin lock must be held while manipulating the requests on the
* request queue.
* request queue; this lock will be taken also from interrupt context, so irq
* disabling is needed for it.
*
* Function returns a pointer to the initialized request queue, or NULL if
* it didn't succeed.
Expand Down

0 comments on commit a038e25

Please sign in to comment.