verify: ensure that verify interval is smaller or equal to blocksize
authorJens Axboe <axboe@fb.com>
Wed, 23 Jul 2014 07:47:26 +0000 (09:47 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 23 Jul 2014 07:47:26 +0000 (09:47 +0200)
Signed-off-by: Jens Axboe <axboe@fb.com>
init.c

diff --git a/init.c b/init.c
index cf1d7f938fb33acfda49b540d94c65249245e070..b4a0cbb91f9c3ce3c01b1db9b5f3b8fa33f5e22f 100644 (file)
--- a/init.c
+++ b/init.c
@@ -635,6 +635,15 @@ static int fixup_options(struct thread_data *td)
                if (o->max_bs[DDIR_WRITE] != o->min_bs[DDIR_WRITE] &&
                    !o->verify_interval)
                        o->verify_interval = o->min_bs[DDIR_WRITE];
+
+               /*
+                * Verify interval must be smaller or equal to the
+                * write size.
+                */
+               if (o->verify_interval > o->min_bs[DDIR_WRITE])
+                       o->verify_interval = o->min_bs[DDIR_WRITE];
+               else if (td_read(td) && o->verify_interval > o->min_bs[DDIR_READ])
+                       o->verify_interval = o->min_bs[DDIR_READ];
        }
 
        if (o->pre_read) {