Merge branch 'verify_warn' of https://github.com/sitsofe/fio
authorJens Axboe <axboe@kernel.dk>
Thu, 31 Aug 2017 14:21:48 +0000 (08:21 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 31 Aug 2017 14:21:48 +0000 (08:21 -0600)
1  2 
init.c

diff --combined init.c
index 164e411c6c8d4a9f576434422dce837edac3a988,7fbfa86654d632b4839139352a6075434822839a..625c937141d1f029d1bbae70da2de1b8df12aded
--- 1/init.c
--- 2/init.c
+++ b/init.c
@@@ -698,23 -698,6 +698,23 @@@ static int fixup_options(struct thread_
        if (o->iodepth_batch_complete_min > o->iodepth_batch_complete_max)
                o->iodepth_batch_complete_max = o->iodepth_batch_complete_min;
  
 +      /*
 +       * There's no need to check for in-flight overlapping IOs if the job
 +       * isn't changing data or the maximum iodepth is guaranteed to be 1
 +       */
 +      if (o->serialize_overlap && !(td->flags & TD_F_READ_IOLOG) &&
 +          (!(td_write(td) || td_trim(td)) || o->iodepth == 1))
 +              o->serialize_overlap = 0;
 +      /*
 +       * Currently can't check for overlaps in offload mode
 +       */
 +      if (o->serialize_overlap && o->io_submit_mode == IO_MODE_OFFLOAD) {
 +              log_err("fio: checking for in-flight overlaps when the "
 +                      "io_submit_mode is offload is not supported\n");
 +              o->serialize_overlap = 0;
 +              ret = warnings_fatal;
 +      }
 +
        if (o->nr_files > td->files_index)
                o->nr_files = td->files_index;
  
                o->size = -1ULL;
  
        if (o->verify != VERIFY_NONE) {
-               if (td_write(td) && o->do_verify && o->numjobs > 1) {
-                       log_info("Multiple writers may overwrite blocks that "
-                               "belong to other jobs. This can cause "
+               if (td_write(td) && o->do_verify && o->numjobs > 1 &&
+                   (o->filename ||
+                    !(o->unique_filename &&
+                      strstr(o->filename_format, "$jobname") &&
+                      strstr(o->filename_format, "$jobnum") &&
+                      strstr(o->filename_format, "$filenum")))) {
+                       log_info("fio: multiple writers may overwrite blocks "
+                               "that belong to other jobs. This can cause "
                                "verification failures.\n");
                        ret = warnings_fatal;
                }
  
+               /*
+                * Warn if verification is requested but no verification of any
+                * kind can be started due to time constraints
+                */
+               if (td_write(td) && o->do_verify && o->timeout &&
+                   o->time_based && !td_read(td) && !o->verify_backlog) {
+                       log_info("fio: verification read phase will never "
+                                "start because write phase uses all of "
+                                "runtime\n");
+                       ret = warnings_fatal;
+               }
                if (!fio_option_is_set(o, refill_buffers))
                        o->refill_buffers = 1;