Fix failure to verify in mixed read/write workload with backlog
[fio.git] / backend.c
index 814d244cadf241028efdf268692201ce6c9a84aa..7343286d53219b0c8d4e8a44ec586f1cd66ac6b8 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -586,11 +586,12 @@ static void do_io(struct thread_data *td)
                ddir = io_u->ddir;
 
                /*
-                * Add verification end_io handler, if asked to verify
-                * a previously written file.
+                * Add verification end_io handler if:
+                *      - Asked to verify (!td_rw(td))
+                *      - Or the io_u is from our verify list (mixed write/ver)
                 */
                if (td->o.verify != VERIFY_NONE && io_u->ddir == DDIR_READ &&
-                   !td_rw(td)) {
+                   ((io_u->flags & IO_U_F_VER_LIST) || !td_rw(td))) {
                        if (td->o.verify_async)
                                io_u->end_io = verify_io_u_async;
                        else