From: Josef Bacik Date: Tue, 9 Jul 2013 00:32:50 +0000 (-0400) Subject: Make sure io_u->buflen is aligned to the verify_interval X-Git-Tag: fio-2.1.2~64 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a9f70b1f50879346fb065497951352ad4e1e0f11;p=fio.git Make sure io_u->buflen is aligned to the verify_interval If you specify verify and bs_unaligned you can make fio blow up in interesting ways. This is because the verify code assumes that the buflens will be bs aligned and therefore aligned to the verify_interval. However this isn't the case for bs_unaligned. So to fix this make sure we are always aligned to verify_interval. This keeps us from reading off the end of our io buf, or worse writing past the end of it and makes this fio job pass properly instead of blowing up. Thanks, Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index 11672cf3..865c5826 100644 --- a/io_u.c +++ b/io_u.c @@ -459,6 +459,10 @@ 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) + buflen = (buflen + td->o.verify_interval - 1) & + ~(td->o.verify_interval - 1); + if (!td->o.bs_unaligned && is_power_of_2(minbs)) buflen = (buflen + minbs - 1) & ~(minbs - 1);