Commit f287da5c authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

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: default avatarRichael Zhuang <richael.zhuang@arm.com>
Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ia7ad415d051a010e515c21fcb5c73f8835c37f78
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16185


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 075b0d17
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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));