Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625548 > unrolled thread

Re: [PATCH 2/4] fs/block_dev: always invalidate cleancache in invalidate_bdev()

Started byNikolay Borisov <n.borisov.lkml@gmail.com>
First post2017-04-18 21:00 +0200
Last post2017-04-18 21:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/4] fs/block_dev: always invalidate cleancache in  invalidate_bdev() Nikolay Borisov <n.borisov.lkml@gmail.com> - 2017-04-18 21:00 +0200

#1625548 — Re: [PATCH 2/4] fs/block_dev: always invalidate cleancache in invalidate_bdev()

FromNikolay Borisov <n.borisov.lkml@gmail.com>
Date2017-04-18 21:00 +0200
SubjectRe: [PATCH 2/4] fs/block_dev: always invalidate cleancache in invalidate_bdev()
Message-ID<txGw2-1bd-13@gated-at.bofh.it>

On 14.04.2017 17:07, Andrey Ryabinin wrote:
> invalidate_bdev() calls cleancache_invalidate_inode() iff ->nrpages != 0
> which doen't make any sense.
> Make invalidate_bdev() always invalidate cleancache data.
> 
> Fixes: c515e1fd361c ("mm/fs: add hooks to support cleancache")
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> ---
>  fs/block_dev.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index e405d8e..7af4787 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -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);
> +	}

How is this different than the current code? You will only invalidate
the mapping iff ->nrpages > 0 ( I assume it can't go down below 0) ?
Perhaps just remove the if altogether?

>  	/* 99% of the time, we don't need to flush the cleancache on the bdev.
>  	 * But, for the strange corners, lets be cautious
>  	 */
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web