From: Jens Axboe Date: Wed, 11 Nov 2015 01:13:40 +0000 (-0700) Subject: Fix verification error with bsrange and split read/write phase X-Git-Tag: fio-2.2.12~12 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=ced5db250347606cbd966d28cd193cc9f0880dff;hp=0127c57b82cfef26149c04b1d785897a68a6dffa 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 Fixes: a9f70b1f5087 ("Make sure io_u->buflen is aligned to the verify_interval") Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index 6dda5790..6b6b47d0 100644 --- a/io_u.c +++ b/io_u.c @@ -488,7 +488,7 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u, } } - if (td->o.do_verify && td->o.verify != VERIFY_NONE) + if (td->o.verify != VERIFY_NONE) buflen = (buflen + td->o.verify_interval - 1) & ~(td->o.verify_interval - 1);