From: Leah Rumancik Date: Mon, 10 Apr 2023 18:57:15 +0000 (-0700) Subject: engines/io_uring: update getevents max to reflect previously seen events X-Git-Tag: fio-3.35~37^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=ae8646a1e5848994c4f4511aa190178958309c92;hp=a8f6714e91d58f4a2eff4198b9f09c89df75f5cb;p=fio.git engines/io_uring: update getevents max to reflect previously seen events To ensure we don't return more than the requested number of events, update the max events variable after reaping events before subsequent calls to io_getevents system call. Signed-off-by: Leah Rumancik --- diff --git a/engines/io_uring.c b/engines/io_uring.c index f10a4593..7f743c2a 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -529,6 +529,7 @@ static int fio_ioring_getevents(struct thread_data *td, unsigned int min, r = fio_ioring_cqring_reap(td, events, max); if (r) { events += r; + max -= r; if (actual_min != 0) actual_min -= r; continue;