lkml.org 
[lkml]   [2020]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dm writecache: correct uncommitted_block when discarding uncommitted entry


On Fri, 12 Jun 2020, Huaisheng Ye wrote:

> From: Huaisheng Ye <yehs1@lenovo.com>
>
> When uncommitted entry has been discarded, correct wc->uncommitted_block
> for getting the exact number.
>
> Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>

Acked-by: Mikulas Patocka <mpatocka@redhat.com>

Also, add:
Cc: stable@vger.kernel.org

> ---
> drivers/md/dm-writecache.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
> index 4367cc7..64b4527 100644
> --- a/drivers/md/dm-writecache.c
> +++ b/drivers/md/dm-writecache.c
> @@ -855,6 +855,8 @@ static void writecache_discard(struct dm_writecache *wc, sector_t start, sector_
> }
> discarded_something = true;
> }
> + if (!writecache_entry_is_committed(wc, e))
> + wc->uncommitted_blocks--;
> writecache_free_entry(wc, e);
> }
>
> --
> 1.8.3.1
>

\
 
 \ /
  Last update: 2020-06-13 14:41    [W:0.060 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site