From 2979a720f671e836302c01546f9cc9f7988610c8 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 27 Jun 2022 12:20:19 +0100 Subject: [PATCH] Update submitted atomic in submit_all() If the user calls submit_all() directly, the submitted atomic is not updated. Leading to a crash. I suspect most users rely on waiting on a completion to implicitly submit so don't hit this issue. --- src/io_uring/uring.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/io_uring/uring.rs b/src/io_uring/uring.rs index 3e53a74..14c204d 100644 --- a/src/io_uring/uring.rs +++ b/src/io_uring/uring.rs @@ -675,7 +675,9 @@ impl Uring { self.sq.lock().unwrap() }; let _hold_sq_mu = Measure::new(&M.sq_mu_hold); - sq.submit_all(self.flags, self.ring_fd); + let submitted = + sq.submit_all(self.flags, self.ring_fd); + self.submitted.fetch_add(submitted, Release); } fn with_sqe<'a, F, C>(