diff options
author | Vincent Fu <vincent.fu@samsung.com> | 2024-02-16 01:33:21 +0000 |
---|---|---|
committer | Vincent Fu <vincent.fu@samsung.com> | 2024-02-16 09:25:35 -0500 |
commit | 38d01cc56366aa2fd3af42dbab522888b6359dec (patch) | |
tree | b4873e4373f27a7d6498a3ce94e8733e79665d7e | |
parent | 2d0debb3fca7ddc4374624acb8c70fc8292d860d (diff) | |
download | fio-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) { |