Commit 22551da1 authored by Huaisheng Ye's avatar Huaisheng Ye Committed by Sasha Levin
Browse files

dm writecache: correct uncommitted_block when discarding uncommitted entry

commit 39495b12 upstream.

When uncommitted entry has been discarded, correct wc->uncommitted_block
for getting the exact number.

Fixes: 48debafe

 ("dm: add writecache target")
Signed-off-by: default avatarHuaisheng Ye <>
Acked-by: default avatarMikulas Patocka <>
Signed-off-by: default avatarMike Snitzer <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 301cca2f
......@@ -857,6 +857,8 @@ static void writecache_discard(struct dm_writecache *wc, sector_t start, sector_
writecache_wait_for_ios(wc, WRITE);
discarded_something = true;
if (!writecache_entry_is_committed(wc, e))
writecache_free_entry(wc, e);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment