Merge remote-tracking branch 'torvalds/master' into perf/urgent
[linux-2.6-microblaze.git] / drivers / block / loop.c
index a06b994..d58d68f 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/moduleparam.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
+#include <linux/pagemap.h>
 #include <linux/file.h>
 #include <linux/stat.h>
 #include <linux/errno.h>
@@ -1212,6 +1213,9 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
                goto out_unlock;
        }
 
+       if (test_bit(QUEUE_FLAG_WC, &lo->lo_queue->queue_flags))
+               blk_queue_write_cache(lo->lo_queue, false, false);
+
        /* freeze request queue during the transition */
        blk_mq_freeze_queue(lo->lo_queue);