dm writecache: count number of blocks written, not number of write bios
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 11 Jul 2022 20:31:26 +0000 (16:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:13 +0000 (14:23 +0200)
commitfc988f1ca2652a39f604801919ed78db6a9d0486
tree8530a6f4ebdc19c41c89835e84831a4edf82e500
parent3a2500b73a1792671ad00f332d0fc56730a301c1
dm writecache: count number of blocks written, not number of write bios

[ Upstream commit b2676e1482af89714af6988ce5d31a84692e2530 ]

Change dm-writecache, so that it counts the number of blocks written
instead of the number of write bios. Bios can be split and requeued
using the dm_accept_partial_bio function, so counting bios caused
inaccurate results.

Fixes: e3a35d03407c ("dm writecache: add event counters")
Reported-by: Yu Kuai <yukuai1@huaweicloud.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/admin-guide/device-mapper/writecache.rst
drivers/md/dm-writecache.c