aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-writecache.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2022-07-11 16:30:52 -0400
committerMike Snitzer <snitzer@kernel.org>2022-07-14 15:52:32 -0400
commit2c6e755b49d273243431f5f1184654e71221fc78 (patch)
tree2b2e5d478aa4a6ab6989f96b5bd4048326aa1bb6 /drivers/md/dm-writecache.c
parentdm writecache: return void from functions (diff)
downloadlinux-dev-2c6e755b49d273243431f5f1184654e71221fc78.tar.xz
linux-dev-2c6e755b49d273243431f5f1184654e71221fc78.zip
dm writecache: count number of blocks read, not number of read bios
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>
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 9e14717c46a9..a551be5f9b4b 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -1365,6 +1365,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;
}