Subject: [PATCH 1061/2944] io_uring: transform send/recvmsg() -ERESTARTSYS to -EINTR

From: Jens Axboe <[email-masked]>
Date: Mon, 2 Dec 2019 18:49:10 -0700

to #26323578

commit 441cdbd5449b4923cd413d3ba748124f91388be9 upstream.

We should never return -ERESTARTSYS to userspace, transform it into
-EINTR.

Cc: [email-masked] # v5.3+
Signed-off-by: Jens Axboe <[email-masked]>
Signed-off-by: Joseph Qi <[email-masked]>
Acked-by: Xiaoguang Wang <[email-masked]>
---
 fs/io_uring.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index a6d627d..41acec5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1913,6 +1913,8 @@ static int io_send_recvmsg(struct io_kiocb *req, const struct io_uring_sqe *sqe,
 		ret = fn(sock, msg, flags);
 		if (force_nonblock && ret == -EAGAIN)
 			return ret;
+		if (ret == -ERESTARTSYS)
+			ret = -EINTR;
 	}
 
 	io_cqring_add_event(req, ret);
-- 
1.8.3.1