X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=e447539c2051d1ece8714669e53a996a4ca3cbd3;hp=8975591d080acb0efc55894e2f40ec830df9d1fd;hb=de79c9158eae1459970e0df6efc6a2b09d920f15;hpb=e116f2b90f110334e77741227ad4e4600302c718 diff --git a/ioengines.c b/ioengines.c index 8975591d..e447539c 100644 --- a/ioengines.c +++ b/ioengines.c @@ -195,9 +195,13 @@ int td_io_getevents(struct thread_data *td, unsigned int min, unsigned int max, if (r < 0) goto out; } + if (max > td->cur_depth) + max = td->cur_depth; + if (min > max) + max = min; r = 0; - if (td->io_ops->getevents) + if (max && td->io_ops->getevents) r = td->io_ops->getevents(td, min, max, t); out: if (r >= 0)