summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-11-09 19:52:33 -0700
committerJens Axboe <axboe@kernel.dk>2019-11-10 20:29:49 -0700
commit8e3cca12706231daf8daf90dbde59f1665135e48 (patch)
treeb16874f8a3afa054af6c1543eb0172b46b6a1e7e /fs/io_uring.c
parent46568e9be70ff8211d986685f08d919376c32998 (diff)
downloadlwn-8e3cca12706231daf8daf90dbde59f1665135e48.tar.gz
lwn-8e3cca12706231daf8daf90dbde59f1665135e48.zip
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: 17f2fe35d080 ("io_uring: add support for IORING_OP_ACCEPT") Reported-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 737c311c6da5..bbb3889dae41 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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);