Fix verification error with bsrange and split read/write phase
authorJens Axboe <axboe@fb.com>
Wed, 11 Nov 2015 01:13:40 +0000 (18:13 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 11 Nov 2015 01:13:40 +0000 (18:13 -0700)
commitced5db250347606cbd966d28cd193cc9f0880dff
treee393bbee0c8b614aa28f3a94a6c8fb98df29b3ae
parent0127c57b82cfef26149c04b1d785897a68a6dffa
Fix verification error with bsrange and split read/write phase

If you have separate phases for the verify writes and the verify reads,
and fio ends up having to align to the verify interval header size,
then we can end up trimming the buflen on the read side (where
do_verify=1 is set), but not on the write side. This causes a
verification failure. Fix this by always aligning, regardless of
whether do_verify is true or not.

Example job files:

-------------------------------------------------------------------------------
[global]
thread=1
blocksize_range=4k-256k
ioengine=libaio
verify_interval=512
iodepth=64
loops=1
verify_pattern=0x03715998
size=100MB
offset=0
verify_dump=1
filename=/tmp/disk.img

[write-phase]
rw=randwrite
fill_device=1
do_verify=0
-------------------------------------------------------------------------------
[global]
thread=1
blocksize_range=4k-256k
ioengine=libaio
verify_interval=512
iodepth=64
loops=1
verify_pattern=0x03715998
size=100MB
offset=0
verify_dump=1
filename=/tmp/disk.img

[verify-phase]
stonewall
rw=randread
create_serialize=0
do_verify=1
-------------------------------------------------------------------------------

Reported-by: Kevin Vajk <kmv@datera.io>
Fixes: a9f70b1f5087 ("Make sure io_u->buflen is aligned to the verify_interval")
Signed-off-by: Jens Axboe <axboe@fb.com>
io_u.c