From 8a99fdf63e1350fc2c35794e1c1f779885905b29 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 6 Mar 2012 19:24:49 +0100 Subject: [PATCH] Fix another verify segfault If you run this job: [global] ioengine=libaio direct=1 filename=/tmp/foo iodepth=128 size=10M loops=1 group_reporting=1 readwrite=write do_verify=0 verify=md5 numjobs=1 thread verify_dump=1 [small_writes] offset=0G blocksize=512 verify_interval=1M [large_writes] stonewall offset=1G blocksize=1M verify_interval=512 fio crashes because verify_interval is larger than the block size in the small_writes job. Check for this in get_hdr_inc(). Signed-off-by: Jens Axboe --- verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify.c b/verify.c index 5fe78c8c..6dd7f6a0 100644 --- a/verify.c +++ b/verify.c @@ -78,7 +78,7 @@ static unsigned int get_hdr_inc(struct thread_data *td, struct io_u *io_u) unsigned int hdr_inc; hdr_inc = io_u->buflen; - if (td->o.verify_interval) + if (td->o.verify_interval && td->o.verify_interval <= io_u->buflen) hdr_inc = td->o.verify_interval; return hdr_inc; -- 2.25.1