aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Fu <vincent.fu@samsung.com>2024-02-16 01:33:21 +0000
committerVincent Fu <vincent.fu@samsung.com>2024-02-16 09:25:35 -0500
commit38d01cc56366aa2fd3af42dbab522888b6359dec (patch)
treeb4873e4373f27a7d6498a3ce94e8733e79665d7e
parent2d0debb3fca7ddc4374624acb8c70fc8292d860d (diff)
downloadfio-38d01cc56366aa2fd3af42dbab522888b6359dec.tar.gz
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 <vincent.fu@samsung.com>
-rw-r--r--verify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/verify.c b/verify.c
index b438eed6b..b2fede247 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) {