Fix hangs due to iodepth_low
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index ba192a32a985d88e87378d196404cddd10e93936..be2f242a6e2bce92c7225aff1cf462762c1d3998 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1792,6 +1792,8 @@ int io_u_queued_complete(struct thread_data *td, int min_evts,
 
        if (!min_evts)
                tvp = &ts;
+       else if (min_evts > td->cur_depth)
+               min_evts = td->cur_depth;
 
        ret = td_io_getevents(td, min_evts, td->o.iodepth_batch_complete, tvp);
        if (ret < 0) {