]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix async accept on O_NONBLOCK sockets
authorDylan Yudaken <dylany@fb.com>
Thu, 24 Mar 2022 14:34:35 +0000 (07:34 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 24 Mar 2022 22:10:29 +0000 (16:10 -0600)
commit0579501037b1e7a67609d50a5cb3ec770e80eacf
tree983509d071b6ce33493327fe3cfc5236911536fc
parentd682203356c538ff197c2375c67e846b3bd77a91
io_uring: fix async accept on O_NONBLOCK sockets

Do not set REQ_F_NOWAIT if the socket is non blocking. When enabled this
causes the accept to immediately post a CQE with EAGAIN, which means you
cannot perform an accept SQE on a NONBLOCK socket asynchronously.

By removing the flag if there is no pending accept then poll is armed as
usual and when a connection comes in the CQE is posted.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220324143435.2875844-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c