verify: fix verification of uncompleted or errored ios
authorJens Axboe <axboe@fb.com>
Wed, 7 May 2014 01:06:51 +0000 (19:06 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 7 May 2014 01:06:51 +0000 (19:06 -0600)
commit890b665611751661aac1030603175bb7bbde34bc
tree9d51fc06e0214d6b66445d80ec986e17cf6374ea
parent435228488ffd062f4eac710aaa862e04cd20dfee
verify: fix verification of uncompleted or errored ios

Stoo Davies reports:

------

I'm doing some powerfail recovery testing on a storage array over iSCSI.
Host is RHEL 6.4 kernel 2.6.32-358.el6.x86_64.

With fio 2.1.2 -> 2.1.4 the job file below rides through the disks going
away, and continues I/O after they come back, without reporting any
errors.  With fio 2.1.5 -> 2.1.8 when the disks come back fio
immediately reports a meta verification error.

I captured a trace with an finisar analyzer, and can see that after the
disks come back and the host logs back in, a read is issued for an lba
which was never written to.  Since I don't see verification errors
outside of the powerfail testing, I suspect fio isn't correctly handling
failed writes during the time the disks are unavailable.

------

The issue is caused by a change between 2.1.4 and 2.1.5 that started
logging IO for verification at issue time, instead of at completion
time. If the IO only partially completes or completes in error, then
we need to adjust the verification unit so that we verify only what
fio actually wrote.

Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c
io_u.c
iolog.c
iolog.h