dm writecache: correct uncommitted_block when discarding uncommitted entry
PATCH 1/1 dm writecache: correct uncommitted_block when discarding uncommitted entry
From: Huaisheng Ye <[email protected]>
When uncommitted entry has been discarded, correct wc->uncommitted_block for getting the exact number.
--- drivers/md/dm-writecache.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/dm-writecache.c +2 -0
@@ -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); }
Signature · 1 line
1.8.3.1
Quoted 6 lines · Huaisheng Ye
From: Huaisheng Ye <[email protected]>
When uncommitted entry has been discarded, correct
wc->uncommitted_blockfor getting the exact number.Signed-off-by Huaisheng Ye <[email protected]>
Also, add:
Cc: [email protected]
Quoted 20 lines
--- drivers/md/dm-writecache.c | 2 ++ 1 file changed, 2 insertions(+)drivers/md/dm-writecache.c +2
-0@@ -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); }Signature · 1 line
1.8.3.1
Quoted 9 lines · Mikulas Patocka
Quoted 5 lines · Huaisheng Ye
From: Huaisheng Ye <[email protected]>
When uncommitted entry has been discarded, correct
wc->uncommitted_blockfor getting the exact number.
Quoted 6 lines
Quoted 1 line
Signed-off-by Huaisheng Ye <[email protected]>Acked-by Mikulas Patocka <[email protected]>Also, add:
Cc: [email protected]
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).
Mike