]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
mainloop: io_uring: disable IORING_POLL_ADD_MULTI 4304/head
authorAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Fri, 21 Apr 2023 17:23:06 +0000 (19:23 +0200)
committerAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Fri, 21 Apr 2023 17:23:06 +0000 (19:23 +0200)
Let's disable IORING_POLL_ADD_MULTI to workaround an issue
with false-positive POLLIN events in CQ.

In my local setup I managed to fix an issue without this
by making terminal FDs non-blocking, but during full
testsuite execution in Jenkins it was found that issue
still persists. So, let's add this ugly workaround too.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
src/lxc/mainloop.c

index a98e21a21a4340da470fae0c58527e7d37c26730..282ac32505a8341ba8edaaa5274b3e123e374544 100644 (file)
@@ -162,6 +162,16 @@ static int __io_uring_arm(struct lxc_async_descr *descr,
 
        io_uring_prep_poll_add(sqe, handler->fd, EPOLLIN);
 
+       /*
+        * FIXME: workaround an issue with false-positive
+        * io_uring POLL events when multishot mode is enabled.
+        *
+        * It's safe to override oneshot argument here, execution
+        * will go to the same codepath as if kernel lacks IORING_POLL_ADD_MULTI
+        * mode support.
+        */
+       oneshot = true;
+
        /*
         * Raise IORING_POLL_ADD_MULTI to set up a multishot poll. The same sqe
         * will now produce multiple cqes. A cqe produced from a multishot sqe