Re: [GIT PULL] io_uring fixes for 5.10-rc
From: Linus Torvalds
Date: Fri Nov 20 2020 - 15:03:30 EST
On Fri, Nov 20, 2020 at 10:45 AM Jens Axboe <axboe@xxxxxxxxx> wrote:
> Jens Axboe (4):
> proc: don't allow async path resolution of /proc/self components
This one is ok.
> io_uring: handle -EOPNOTSUPP on path resolution
But this one smells. It talks about how it shouldn't block, but the
fact is, it can easily block when the path going through another
filesystem (think ".." to get to root before even hitting /proc/self,
but also think /proc/self/cwd/randompathgoeshere).
The whole concept seems entirely broken anyway. Why would you retry
the failure after doing it asynchronously? If it really doesn't block,
then it shouldn't have been done async in the first place.
IMNSHO, the openat logic is just wrong. And that "ignore_nonblock"
thing is a disgusting hack that is everything that is wrong with
io_uring. Stop doing these kinds of hacky things that will just cause
problems down the line.
I think the correct thing to do is to just start the open
synchronously with an RCU lookup, and if that fails, go to the async
one. And if the async one fails because it's /proc/self, then it just
fails. None of this kind of "it should be ok" stuff.
And that would likely be the faster model anyway - do it synchronously
and immediately for the easy cases.
And if it really is something like "/proc/self/cwd/randompathgoeshere"
that actually will block, maybe io_uring just shouldn't support it?
I've pulled this, but I really object to how io_uring keeps having
subtle bugs, and then they get worked around with this kind of hackery
which really smells like "this will be a subtle bug some time in the
future".
Linus