[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170518104836.389899706@linuxfoundation.org>
Date: Thu, 18 May 2017 12:48:36 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Andrey Ryabinin <aryabinin@...tuozzo.com>,
Jan Kara <jack@...e.cz>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
Jens Axboe <axboe@...nel.dk>,
Johannes Weiner <hannes@...xchg.org>,
Alexey Kuznetsov <kuznet@...tuozzo.com>,
Christoph Hellwig <hch@....de>,
Nikolay Borisov <n.borisov.lkml@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [PATCH 4.9 54/80] fs/block_dev: always invalidate cleancache in invalidate_bdev()
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Ryabinin <aryabinin@...tuozzo.com>
commit a5f6a6a9c72eac38a7fadd1a038532bc8516337c upstream.
invalidate_bdev() calls cleancache_invalidate_inode() iff ->nrpages != 0
which doen't make any sense.
Make sure that invalidate_bdev() always calls cleancache_invalidate_inode()
regardless of mapping->nrpages value.
Fixes: c515e1fd361c ("mm/fs: add hooks to support cleancache")
Link: http://lkml.kernel.org/r/20170424164135.22350-3-aryabinin@virtuozzo.com
Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
Reviewed-by: Jan Kara <jack@...e.cz>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: Alexey Kuznetsov <kuznet@...tuozzo.com>
Cc: Christoph Hellwig <hch@....de>
Cc: Nikolay Borisov <n.borisov.lkml@...il.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/block_dev.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -102,12 +102,11 @@ void invalidate_bdev(struct block_device
{
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
*/
Powered by blists - more mailing lists