From f287da5cb0109f6f9b221759d7cba58317a429ce Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Mon, 9 Jan 2023 20:46:01 +0900 Subject: [PATCH] bdev: Fix the bug that counters for copy command were not reset Fix the bug that counters for copy command, bytes_copied, num_copy_ops, and copy_latency_ticks were not reset via bdev_reset_io_stat() function. Reported-by: Richael Zhuang Signed-off-by: Shuhei Matsumoto Change-Id: Ia7ad415d051a010e515c21fcb5c73f8835c37f78 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16185 Reviewed-by: Aleksey Marchuk Reviewed-by: Konrad Sztyber Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- lib/bdev/bdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c index 8a1c7dbc8..2120fec6f 100644 --- a/lib/bdev/bdev.c +++ b/lib/bdev/bdev.c @@ -3786,9 +3786,12 @@ bdev_reset_io_stat(struct spdk_bdev_io_stat *stat, enum bdev_reset_stat_mode mod stat->num_write_ops = 0; stat->bytes_unmapped = 0; stat->num_unmap_ops = 0; + stat->bytes_copied = 0; + stat->num_copy_ops = 0; stat->read_latency_ticks = 0; stat->write_latency_ticks = 0; stat->unmap_latency_ticks = 0; + stat->copy_latency_ticks = 0; if (stat->io_error != NULL) { memset(stat->io_error, 0, sizeof(struct spdk_bdev_io_error_stat));