diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 9ad527ff9974..2924bddb4a94 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -102,12 +102,11 @@ void invalidate_bdev(struct block_device *bdev) | |||
102 | { | 102 | { |
103 | struct address_space *mapping = bdev->bd_inode->i_mapping; | 103 | struct address_space *mapping = bdev->bd_inode->i_mapping; |
104 | 104 | ||
105 | if (mapping->nrpages == 0) | 105 | if (mapping->nrpages) { |
106 | return; | 106 | invalidate_bh_lrus(); |
107 | 107 | lru_add_drain_all(); /* make sure all lru add caches are flushed */ | |
108 | invalidate_bh_lrus(); | 108 | invalidate_mapping_pages(mapping, 0, -1); |
109 | lru_add_drain_all(); /* make sure all lru add caches are flushed */ | 109 | } |
110 | invalidate_mapping_pages(mapping, 0, -1); | ||
111 | /* 99% of the time, we don't need to flush the cleancache on the bdev. | 110 | /* 99% of the time, we don't need to flush the cleancache on the bdev. |
112 | * But, for the strange corners, lets be cautious | 111 | * But, for the strange corners, lets be cautious |
113 | */ | 112 | */ |