block: move q->unplug_work initialization

modprobe loop; rmmod loop effectively creates a blk_queue and destroys it
which results in q->unplug_work being canceled without it ever being
initialized.

Therefore, move the initialization of q->unplug_work from
blk_queue_make_request() to blk_alloc_queue*().

Reported-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Peter Zijlstra 2008-10-16 13:44:57 +02:00 • committed by Jens Axboe
commit 713ada9ba9
2 changed files with 1 additions and 2 deletions

View file

@ -141,8 +141,6 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
if (q->unplug_delay == 0)
q->unplug_delay = 1;
INIT_WORK(&q->unplug_work, blk_unplug_work);
q->unplug_timer.function = blk_unplug_timeout;
q->unplug_timer.data = (unsigned long)q;