From ae8646a1e5848994c4f4511aa190178958309c92 Mon Sep 17 00:00:00 2001 From: Leah Rumancik Date: Mon, 10 Apr 2023 11:57:15 -0700 Subject: [PATCH 1/1] 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 --- engines/io_uring.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.25.1