]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/blk-core.c
block: blk_cleanup_queue() should call blk_sync_queue()
[linux-2.6-omap-h63xx.git] / block / blk-core.c
index d768a8ddc173a7ae5b0162c43218bd244e1aadb7..37fba001bdcf6b9a0174fdf40c6c8eb3eeda7fac 100644 (file)
@@ -436,6 +436,14 @@ void blk_put_queue(struct request_queue *q)
 
 void blk_cleanup_queue(struct request_queue *q)
 {
+       /*
+        * We know we have process context here, so we can be a little
+        * cautious and ensure that pending block actions on this device
+        * are done before moving on. Going into this function, we should
+        * not have processes doing IO to this device.
+        */
+       blk_sync_queue(q);
+
        mutex_lock(&q->sysfs_lock);
        queue_flag_set_unlocked(QUEUE_FLAG_DEAD, q);
        mutex_unlock(&q->sysfs_lock);