From bb66cfd2ae8464ce44d16ab33621589703029906 Mon Sep 17 00:00:00 2001 From: jimharris Date: Tue, 8 Oct 2013 15:47:22 +0000 Subject: Extend some 32-bit fields and variables to 64-bit to prevent overflow when calculating stats in nvmecontrol perftest. Sponsored by: Intel Reported by: Joe Golio Reviewed by: carl Approved by: re (hrs) MFC after: 1 week --- sys/dev/nvme/nvme_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev/nvme/nvme_test.c') diff --git a/sys/dev/nvme/nvme_test.c b/sys/dev/nvme/nvme_test.c index 89bcc00..24f65cc 100644 --- a/sys/dev/nvme/nvme_test.c +++ b/sys/dev/nvme/nvme_test.c @@ -53,7 +53,7 @@ struct nvme_io_test_thread { void *buf; uint32_t size; uint32_t time; - uint32_t io_completed; + uint64_t io_completed; }; struct nvme_io_test_internal { @@ -66,7 +66,7 @@ struct nvme_io_test_internal { uint32_t td_active; uint32_t td_idx; uint32_t flags; - uint32_t io_completed[NVME_TEST_MAX_THREADS]; + uint64_t io_completed[NVME_TEST_MAX_THREADS]; }; static void @@ -90,8 +90,8 @@ nvme_ns_bio_test(void *arg) struct cdev *dev; void *buf; struct timeval t; - uint64_t offset; - uint32_t idx, io_completed = 0; + uint64_t io_completed = 0, offset; + uint32_t idx; #if __FreeBSD_version >= 900017 int ref; #endif -- cgit v1.1