From 38d01cc56366aa2fd3af42dbab522888b6359dec Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Fri, 16 Feb 2024 01:33:21 +0000 Subject: [PATCH] verify: fix integer sizes in verify state file nofiles and depth are 32-bit integers. So we shouldn't use 64-bit conversion functions and casts. The current code actually works fine on little-endian platforms since the conversion is a noop but this is broken on big-endian platforms. Fixes: 94a6e1bb ("Fix verify state for multiple files") Signed-off-by: Vincent Fu --- verify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verify.c b/verify.c index b438eed6..b2fede24 100644 --- a/verify.c +++ b/verify.c @@ -1619,8 +1619,8 @@ struct all_io_list *get_all_io_list(int save_mask, size_t *sz) comps = fill_file_completions(td, s, &index); s->no_comps = cpu_to_le64((uint64_t) comps); - s->depth = cpu_to_le64((uint64_t) td->o.iodepth); - s->nofiles = cpu_to_le64((uint64_t) td->o.nr_files); + s->depth = cpu_to_le32((uint32_t) td->o.iodepth); + s->nofiles = cpu_to_le32((uint32_t) td->o.nr_files); s->numberio = cpu_to_le64((uint64_t) td->io_issues[DDIR_WRITE]); s->index = cpu_to_le64((uint64_t) __td_index); if (td->random_state.use64) { -- 2.25.1