blktrace: ignore 0 byte writes
[fio.git] / blktrace.c
index 1d5403a5a0fc59cad41278ed8a368033c733fcf0..721bcd4bc422a93f7333ef54185f000c6853f571 100644 (file)
@@ -310,7 +310,13 @@ static void handle_trace_fs(struct thread_data *td, struct blk_io_trace *t,
 
        rw = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0;
 
-       if (t->bytes > rw_bs[rw])
+       /*
+        * Need to figure out why 0 byte writes end up here sometimes, for
+        * now just ignore them.
+        */
+       if (!t->bytes)
+               return;
+       else if (t->bytes > rw_bs[rw])
                rw_bs[rw] = t->bytes;
 
        ios[rw]++;