Fix "verify bad_hdr rand_seed" for requeued I/Os
authorHorshack <horshack@live.com>
Sun, 26 Feb 2023 15:12:05 +0000 (10:12 -0500)
committerHorshack <horshack@live.com>
Mon, 27 Feb 2023 15:08:38 +0000 (10:08 -0500)
commitad21b61d27fd94b4c94a5e26842106d76ea54ba0
treec37cdbd89b7e16912f2f445d09f1ed083959d3ff
parent6946ad5940565d573d85e210b8ea4da5884f0323
Fix "verify bad_hdr rand_seed" for requeued I/Os

On configurations that can cause I/Os to be internally requeued from
FIO_Q_BUSY such as '--iodepth_batch_complete_max', and the workload has
verify enabled, the subsequent verification of the data fails with a bad
verify rand_seed because the pattern for the I/O is generated twice for
the same I/O, causing the seed to become out of sync when the verify is
later performed. The seed is generate twice because do_io() handles the
I/O twice, first when it originates the I/O and again when it later gets
the same I/O back from get_io_u() after it's is pulled from the requeue
list, which is where the first submission landed due to the workload
reaching '--iodepth_batch_complete_max'.

The fix is for do_io() to track when it has generated the verify pattern
for an I/O via a new io_u flag 'IO_U_F_PATTERN_DONE', avoiding a second
call to populate_verify_io_u() when that flag is detected.

Link: https://github.com/axboe/fio/issues/1526
Signed-off-by: Adam Horshack (horshack@live.com)
backend.c
io_u.c
io_u.h