verify: don't adjust verification length based on interval when unaligned
authorJens Axboe <axboe@kernel.dk>
Fri, 5 Jan 2018 20:38:40 +0000 (13:38 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 5 Jan 2018 20:38:40 +0000 (13:38 -0700)
It's perfectly fine to have a verification length that exceeds the
default verify interval when we have unaligned block sizes and
using block size ranges, since the verify interval just defaults to
the smallest blocksize.

Fixes: https://github.com/axboe/fio/issues/509
Signed-off-by: Jens Axboe <axboe@kernel.dk>
verify.c

index 2faeaad..b178450 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -87,8 +87,13 @@ static unsigned int get_hdr_inc(struct thread_data *td, struct io_u *io_u)
 {
        unsigned int hdr_inc;
 
+       /*
+        * If we use bs_unaligned, buflen can be larger than the verify
+        * interval (which just defaults to the smallest blocksize possible).
+        */
        hdr_inc = io_u->buflen;
-       if (td->o.verify_interval && td->o.verify_interval <= io_u->buflen)
+       if (td->o.verify_interval && td->o.verify_interval <= io_u->buflen &&
+           !td->o.bs_unaligned)
                hdr_inc = td->o.verify_interval;
 
        return hdr_inc;
@@ -1175,7 +1180,6 @@ static void fill_hdr(struct thread_data *td, struct io_u *io_u,
                     struct verify_header *hdr, unsigned int header_num,
                     unsigned int header_len, uint64_t rand_seed)
 {
-
        if (td->o.verify != VERIFY_PATTERN_NO_HDR)
                __fill_hdr(td, io_u, hdr, header_num, header_len, rand_seed);
 }