Fix verify_backlog start verification before finish writing
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index f68b2139ef8de06d6946b8e3fbed208dc0691a55..4264cd54115ca39e2e70d97857179f009d24b742 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1623,6 +1623,17 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                                         utime_since_now(&td->start));
                }
 
+               /*
+                * Verify_backlog enable: We need to log the write job after
+                * finishing it to prevent verifying before finish writing.
+                */
+               if (td_write(td) && idx == DDIR_WRITE &&
+                   td->o.do_verify &&
+                   td->o.verify != VERIFY_NONE &&
+                   !td->o.experimental_verify &&
+                   (td->flags & TD_F_VER_BACKLOG))
+                       log_io_piece(td, io_u);
+
                icd->bytes_done[idx] += bytes;
 
                if (io_u->end_io) {