Linux filesystem development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Xi Ruoyao <xry111@xry111.site>, io-uring@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, brauner@kernel.org,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Juan José" <soyjuanarbol@gmail.com>
Subject: Re: [PATCH 6/6] io_uring/epoll: disallow adding an epoll file to an epoll context
Date: Wed, 29 Jul 2026 04:54:22 -0600	[thread overview]
Message-ID: <427b15c8-c168-4e2a-ac38-b00dc00400d3@kernel.dk> (raw)
In-Reply-To: <605939add4dfb674bd7ab39ef8dbd3fd22e754e4.camel@xry111.site>

On 7/28/26 7:29 PM, Xi Ruoyao wrote:
> On Thu, 2026-05-14 at 08:07 -0600, Jens Axboe wrote:
>> One of the nastier things about epoll is how it allows adding epoll
>> files to epoll contexts. This leads to all sorts of loop detection
>> code, and has been a source of issues in the past.
>>
>> Arguably adding IORING_EPOLL_CTL is a historical mistake on the
>> io_uring side, but we're kind of stuck with it now as it does seem
>> to be in use according to code searches. But we can at least minimize
>> the damage a bit and just disallow this part of epoll, where nesting
>> issues can arise.
> 
> libuv uses this ... thing and there's even a test case against
> exercising the code path adding an epoll file:
> 
> - https://github.com/libuv/libuv/commit/3b6a1a14caee
> - https://github.com/libuv/libuv/blob/09591002d38e/test/test-poll.c#L690
> 
> And the test triggers an abort on the EINVAL at
> https://github.com/libuv/libuv/blob/09591002d38e/src/unix/linux.c#L1360

Thanks, I'll take a look.

> I'm unsure what to do here.

I think it's pretty simple - if libuv is using nesting already, then
we will have to revert this single commit before 7.2 release.

-- 
Jens Axboe


  reply	other threads:[~2026-07-29 10:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 14:07 [PATCHSET v2 0/6] io_uring related epoll cleanups Jens Axboe
2026-05-14 14:07 ` [PATCH 1/6] eventpoll: pass struct epoll_filefd through ep_find() and ep_insert() Jens Axboe
2026-05-14 14:07 ` [PATCH 2/6] eventpoll: export is_file_epoll() Jens Axboe
2026-05-14 14:07 ` [PATCH 3/6] eventpoll: add file based control interface Jens Axboe
2026-05-14 14:07 ` [PATCH 4/6] eventpoll: rename struct epoll_filefd to epoll_key Jens Axboe
2026-05-14 14:07 ` [PATCH 5/6] io_uring/epoll: switch to using do_epoll_ctl_file() interface Jens Axboe
2026-05-14 14:07 ` [PATCH 6/6] io_uring/epoll: disallow adding an epoll file to an epoll context Jens Axboe
2026-07-29  1:29   ` Xi Ruoyao
2026-07-29 10:54     ` Jens Axboe [this message]
2026-07-29 15:09       ` Linus Torvalds
2026-05-15 15:08 ` (subset) [PATCHSET v2 0/6] io_uring related epoll cleanups Christian Brauner
2026-05-15 15:25   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=427b15c8-c168-4e2a-ac38-b00dc00400d3@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=soyjuanarbol@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox