summaryrefslogtreecommitdiff
path: root/drivers/md/dm-writecache.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2022-07-11 16:30:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-17 14:23:13 +0200
commit3a2500b73a1792671ad00f332d0fc56730a301c1 (patch)
tree1e88bbc5e7b29e4266c8e643f8c47ef980c2941a /drivers/md/dm-writecache.c
parent880c4513eb3360d3ee86556331d9645d87ad2cbb (diff)
downloadlinux-3a2500b73a1792671ad00f332d0fc56730a301c1.tar.gz
linux-3a2500b73a1792671ad00f332d0fc56730a301c1.tar.bz2
linux-3a2500b73a1792671ad00f332d0fc56730a301c1.zip
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>
Diffstat (limited to 'drivers/md/dm-writecache.c')
-rw-r--r--drivers/md/dm-writecache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index e3d0a9bb27b5..9d6b7b706a65 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -1364,6 +1364,7 @@ read_next_block:
}
} else {
writecache_map_remap_origin(wc, bio, e);
+ wc->stats.reads += (bio->bi_iter.bi_size - wc->block_size) >> wc->block_size_bits;
map_op = WC_MAP_REMAP_ORIGIN;
}