Read stats for backlog verifies not reported for time-expired workloads
[fio.git] / backend.c
index d8f4f2a508119638b212d9dc1c3481ca50e7a989..c6b97dd9c802ed7ab80439dbbfe2f7eefca3a102 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -682,7 +682,7 @@ static void do_verify(struct thread_data *td, uint64_t verify_bytes)
                                break;
                        }
                } else {
-                       if (ddir_rw_sum(td->bytes_done) + td->o.rw_min_bs > verify_bytes)
+                       if (td->bytes_verified + td->o.rw_min_bs > verify_bytes)
                                break;
 
                        while ((io_u = get_io_u(td)) != NULL) {
@@ -711,6 +711,8 @@ static void do_verify(struct thread_data *td, uint64_t verify_bytes)
                                        break;
                                } else if (io_u->ddir == DDIR_WRITE) {
                                        io_u->ddir = DDIR_READ;
+                                       io_u->numberio = td->verify_read_issues;
+                                       td->verify_read_issues++;
                                        populate_verify_io_u(td, io_u);
                                        break;
                                } else {
@@ -1030,8 +1032,10 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
                        break;
                }
 
-               if (io_u->ddir == DDIR_WRITE && td->flags & TD_F_DO_VERIFY)
+               if (io_u->ddir == DDIR_WRITE && td->flags & TD_F_DO_VERIFY) {
+                       io_u->numberio = td->io_issues[io_u->ddir];
                        populate_verify_io_u(td, io_u);
+               }
 
                ddir = io_u->ddir;
 
@@ -1297,7 +1301,8 @@ static int init_io_u(struct thread_data *td)
                }
        }
 
-       init_io_u_buffers(td);
+       if (init_io_u_buffers(td))
+               return 1;
 
        if (init_file_completion_logging(td, max_units))
                return 1;
@@ -1914,7 +1919,8 @@ static void *thread_main(void *data)
                        }
                } while (1);
 
-               if (td_read(td) && td->io_bytes[DDIR_READ])
+               if (td->io_bytes[DDIR_READ] && (td_read(td) ||
+                       ((td->flags & TD_F_VER_BACKLOG) && td_write(td))))
                        update_runtime(td, elapsed_us, DDIR_READ);
                if (td_write(td) && td->io_bytes[DDIR_WRITE])
                        update_runtime(td, elapsed_us, DDIR_WRITE);