Commit 8e3cca12 authored by Jens Axboe's avatar Jens Axboe

io_uring: convert accept4() -ERESTARTSYS into -EINTR

If we cancel a pending accept operating with a signal, we get
-ERESTARTSYS returned. Turn that into -EINTR for userspace, we should
not be return -ERESTARTSYS.

Fixes: 17f2fe35 ("io_uring: add support for IORING_OP_ACCEPT")
Reported-by: default avatarHrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 46568e9b
......@@ -1887,6 +1887,8 @@ static int io_accept(struct io_kiocb *req, const struct io_uring_sqe *sqe,
req->work.flags |= IO_WQ_WORK_NEEDS_FILES;
return -EAGAIN;
}
if (ret == -ERESTARTSYS)
ret = -EINTR;
if (ret < 0 && (req->flags & REQ_F_LINK))
req->flags |= REQ_F_FAIL_LINK;
io_cqring_add_event(req, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment