From: Alexander Mikhalitsyn Date: Fri, 21 Apr 2023 17:23:06 +0000 (+0200) Subject: mainloop: io_uring: disable IORING_POLL_ADD_MULTI X-Git-Tag: v6.0.0~58^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fd671dbce98d139e52e8c4266f1050ef49ea8af;p=thirdparty%2Flxc.git mainloop: io_uring: disable IORING_POLL_ADD_MULTI 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 --- diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c index a98e21a21..282ac3250 100644 --- a/src/lxc/mainloop.c +++ b/src/lxc/mainloop.c @@ -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