]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | Subject: block: move q->unplug_work initialization |
2 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
3 | Date: Fri Oct 17 08:46:57 2008 +0200: | |
4 | Git: 713ada9ba94f2ad874cffd074b83e3dc681ca82f | |
5 | ||
6 | modprobe loop; rmmod loop effectively creates a blk_queue and destroys it | |
7 | which results in q->unplug_work being canceled without it ever being | |
8 | initialized. | |
9 | ||
10 | Therefore, move the initialization of q->unplug_work from | |
11 | blk_queue_make_request() to blk_alloc_queue*(). | |
12 | ||
13 | Reported-by: Alexey Dobriyan <adobriyan@gmail.com> | |
14 | Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
15 | Signed-off-by: Jens Axboe <jens.axboe@oracle.com> | |
16 | Signed-off-by: Hannes Reinecke <hare@suse.de> | |
17 | ||
18 | --- | |
19 | block/blk-core.c | 1 + | |
20 | block/blk-settings.c | 2 -- | |
21 | 2 files changed, 1 insertion(+), 2 deletions(-) | |
22 | ||
23 | --- a/block/blk-core.c | |
24 | +++ b/block/blk-core.c | |
25 | @@ -515,6 +515,7 @@ struct request_queue *blk_alloc_queue_no | |
26 | init_timer(&q->unplug_timer); | |
27 | setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); | |
28 | INIT_LIST_HEAD(&q->timeout_list); | |
29 | + INIT_WORK(&q->unplug_work, blk_unplug_work); | |
30 | ||
31 | kobject_init(&q->kobj, &blk_queue_ktype); | |
32 | ||
33 | --- a/block/blk-settings.c | |
34 | +++ b/block/blk-settings.c | |
35 | @@ -135,8 +135,6 @@ void blk_queue_make_request(struct reque | |
36 | if (q->unplug_delay == 0) | |
37 | q->unplug_delay = 1; | |
38 | ||
39 | - INIT_WORK(&q->unplug_work, blk_unplug_work); | |
40 | - | |
41 | q->unplug_timer.function = blk_unplug_timeout; | |
42 | q->unplug_timer.data = (unsigned long)q; | |
43 |