Skip to content
Snippets Groups Projects
Commit 41392d7e authored by Huaisheng Ye's avatar Huaisheng Ye Committed by Yang Yingliang
Browse files

dm writecache: correct uncommitted_block when discarding uncommitted entry


stable inclusion
from linux-4.19.131
commit a33e2d0aa4e265ae5ea06778516b863b17a7c737

--------------------------------

commit 39495b12 upstream.

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

Fixes: 48debafe ("dm: add writecache target")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarHuaisheng Ye <yehs1@lenovo.com>
Acked-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 05219f8a
No related branches found
No related tags found
No related merge requests found
......@@ -811,6 +811,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))
wc->uncommitted_blocks--;
writecache_free_entry(wc, e);
}
......
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