verify: fix bytes_done accounting of experimental verify
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 20 Oct 2022 06:38:51 +0000 (15:38 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 24 Oct 2022 14:34:57 +0000 (10:34 -0400)
commit191d6634e8a692bef15143715c88920987ecaa89
treeceddeca22d44ca4937f400599d668ee8754bae8d
parentad74db37bb75b58777687add392d2b875353526c
verify: fix bytes_done accounting of experimental verify

The commit 55312f9f5572 ("Add ->bytes_done[] to struct thread_data")
moved bytes_done[] on stack to struct thread_data. However, this unified
two bytes_done[] in do_io() and do_verify() stacks into single
td->bytes_done[]. This caused wrong condition check in do_verify() in
experimental verify path since td->bytes_done[] holds values for do_io()
not for do_verify(). This caused unexpected loop break in do_verify()
and verify read skip when experimental_verify=1 option is specified.

To fix this, add bytes_verified to struct thread_data for do_verify() in
same manner as bytes_done[] for do_io(). Introduce a helper function
io_u_update_bytes_done() to factor out same code for bytes_done[] and
bytes_verified[].

Fixes: 55312f9f5572 ("Add ->bytes_done[] to struct thread_data")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
backend.c
fio.h
io_u.c
libfio.c
rate-submit.c