]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.drivers/block-call-sync-on-cleanup
Imported linux-2.6.27.39 suse/xen patches.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / block-call-sync-on-cleanup
CommitLineData
2cb7cef9
BS
1Subject: block: blk_cleanup_queue() should call blk_sync_queue()
2From: Jens Axboe <jens.axboe@oracle.com>
3Date: Thu Oct 9 08:56:18 2008 +0200:
4Git: e3335de94067dbebe22e3962632ead34e832cb60
5
6When a driver calls blk_cleanup_queue(), the device should be fully idle.
7However, the block layer may have pending plugging timers and the IO
8schedulers may have pending work in the work queues. So quisce the device
9by waiting for the timer and flushing the work queues.
10
11Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
12Signed-off-by: Hannes Reinecke <hare@suse.de>
13
14---
15 block/blk-core.c | 8 ++++++++
16 1 file changed, 8 insertions(+)
17
18--- a/block/blk-core.c
19+++ b/block/blk-core.c
20@@ -435,6 +435,14 @@ void blk_put_queue(struct request_queue
21
22 void blk_cleanup_queue(struct request_queue *q)
23 {
24+ /*
25+ * We know we have process context here, so we can be a little
26+ * cautious and ensure that pending block actions on this device
27+ * are done before moving on. Going into this function, we should
28+ * not have processes doing IO to this device.
29+ */
30+ blk_sync_queue(q);
31+
32 mutex_lock(&q->sysfs_lock);
33 queue_flag_set_unlocked(QUEUE_FLAG_DEAD, q);
34 mutex_unlock(&q->sysfs_lock);