dm writecache: count number of blocks read, not number of read bios
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 11 Jul 2022 20:30:52 +0000 (16:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:13 +0000 (14:23 +0200)
commit3a2500b73a1792671ad00f332d0fc56730a301c1
tree1e88bbc5e7b29e4266c8e643f8c47ef980c2941a
parent880c4513eb3360d3ee86556331d9645d87ad2cbb
dm writecache: count number of blocks read, not number of read bios

[ Upstream commit 2c6e755b49d273243431f5f1184654e71221fc78 ]

Change dm-writecache, so that it counts the number of blocks read
instead of the number of read 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