diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-05-31 12:02:46 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-05-31 12:02:46 +0800 |
commit | dc06d1ba220ca16ebbca598bb45242ec5e818cb2 (patch) | |
tree | ef66bd14901ec3a07cf65842a3b63884a64be529 /fs/block_dev.c | |
parent | 018ed21cf3b7cb618c63294793d63b23ce4afe24 (diff) | |
parent | a898540914d4136f29bc738ce593c1c501006f23 (diff) |
Merge branch 'linux-linaro-lsk-v4.1' into linux-linaro-lsk-v4.1-androidlsk-v4.1-17.06-androidlsk-v4.1-17.05-androidlinux-linaro-lsk-v4.1-android
Diffstat (limited to 'fs/block_dev.c')
-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 e03a88dc17c4..246deda36f45 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -88,12 +88,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 */ |