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 <richael.zhuang@arm.com>
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ia7ad415d051a010e515c21fcb5c73f8835c37f78
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16185
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Shuhei Matsumoto 2023-01-09 20:46:01 +09:00 committed by Tomasz Zawadzki
parent 075b0d1736
commit f287da5cb0

View File

@ -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));