From ced5db250347606cbd966d28cd193cc9f0880dff Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 10 Nov 2015 18:13:40 -0700 Subject: [PATCH 1/1] 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 --- io_u.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.25.1