]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/block_dev.c
fs/block_dev: always invalidate cleancache in invalidate_bdev()
[mirror_ubuntu-zesty-kernel.git] / fs / block_dev.c
index a0d821704c146fd8cf91a215e1b7d918185bb3d7..99d4e1af5502e45ca1725d94ae08867f0accf2f6 100644 (file)
@@ -103,12 +103,11 @@ void invalidate_bdev(struct block_device *bdev)
 {
        struct address_space *mapping = bdev->bd_inode->i_mapping;
 
-       if (mapping->nrpages == 0)
-               return;
-
-       invalidate_bh_lrus();
-       lru_add_drain_all();    /* make sure all lru add caches are flushed */
-       invalidate_mapping_pages(mapping, 0, -1);
+       if (mapping->nrpages) {
+               invalidate_bh_lrus();
+               lru_add_drain_all();    /* make sure all lru add caches are flushed */
+               invalidate_mapping_pages(mapping, 0, -1);
+       }
        /* 99% of the time, we don't need to flush the cleancache on the bdev.
         * But, for the strange corners, lets be cautious
         */