io_uring: check file O_NONBLOCK state for accept
PATCH 1/1 io_uring: check file O_NONBLOCK state for accept
If the socket is O_NONBLOCK, we should complete the accept request with -EAGAIN when data is not ready.
Signed-off-by Jiufei Xue <[email protected]>
--- fs/io_uring.c | 3 +++ 1 file changed, 3 insertions(+)
fs/io_uring.c +3 -0
@@ -3969,6 +3969,9 @@ static int io_accept(struct io_kiocb *req, bool force_nonblock) {int ret; +if (req->file->f_flags &O_NONBLOCK ) + req->flags |=REQ_F_NOWAIT ; + ret =__io_accept (req, force_nonblock);if (ret == -EAGAIN && force_nonblock) { req->work.func = io_accept_finish;
Signature · 1 line
1.8.3.1
Quoted 2 lines · Jiufei Xue
If the socket is
O_NONBLOCK, we should complete the accept request with-EAGAINwhen data is not ready.
Applied, thanks.
Signature · 1 line
Jens Axboe