[Devel] [PATCH RHEL7 COMMIT] fs/block_dev: always invalidate cleancache in invalidate_bdev()

Konstantin Khorenko khorenko at virtuozzo.com
Thu Apr 13 03:41:06 PDT 2017


The commit is pushed to "branch-rh7-3.10.0-514.10.2.vz7.29.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.10.2.vz7.29.15
------>
commit 5ffa7e4f1451a245f9fc4ba94df77c2a0e911add
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Thu Apr 13 14:41:06 2017 +0400

    fs/block_dev: always invalidate cleancache in invalidate_bdev()
    
    invalidate_bdev() calls cleancache_invalidate_inode() iff ->nrpages != 0
    which doen't make any sense.
    Make invalidate_bdev() always invalidate cleancache data.
    
    https://jira.sw.ru/browse/PSBM-63908
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 fs/block_dev.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 967588e..8f2c6ee 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -108,12 +108,12 @@ 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);
+	/* FIXME: Shouldn't we add '|| mapping->nrexceptional' ? */
+	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
 	 */


More information about the Devel mailing list