linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dm writecache: correct uncommitted_block when discarding uncommitted entry
@ 2020-06-12 15:59 Huaisheng Ye
  2020-06-13 12:40 ` Mikulas Patocka
  0 siblings, 1 reply; 3+ messages in thread
From: Huaisheng Ye @ 2020-06-12 15:59 UTC (permalink / raw)
  To: mpatocka, snitzer, agk; +Cc: dm-devel, linux-kernel, Huaisheng Ye

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dm writecache: correct uncommitted_block when discarding uncommitted entry
  2020-06-12 15:59 [PATCH] dm writecache: correct uncommitted_block when discarding uncommitted entry Huaisheng Ye
@ 2020-06-13 12:40 ` Mikulas Patocka
  2020-06-17 16:41   ` Mike Snitzer
  0 siblings, 1 reply; 3+ messages in thread
From: Mikulas Patocka @ 2020-06-13 12:40 UTC (permalink / raw)
  To: Huaisheng Ye; +Cc: snitzer, agk, dm-devel, linux-kernel, Huaisheng Ye



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
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dm writecache: correct uncommitted_block when discarding uncommitted entry
  2020-06-13 12:40 ` Mikulas Patocka
@ 2020-06-17 16:41   ` Mike Snitzer
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2020-06-17 16:41 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: Huaisheng Ye, agk, dm-devel, linux-kernel, Huaisheng Ye

On Sat, Jun 13 2020 at  8:40am -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> 
> 
> 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

I picked this up for 5.8 but I inverted the patch order because this
stable@ fix was dependent on the prior patch to skip waiting if in pmem
mode (due to locality of changes within same function).

See:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.8&id=39495b12ef1cf602e6abd350dce2ef4199906531

Mike


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-17 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 15:59 [PATCH] dm writecache: correct uncommitted_block when discarding uncommitted entry Huaisheng Ye
2020-06-13 12:40 ` Mikulas Patocka
2020-06-17 16:41   ` Mike Snitzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).