diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-01-31 08:34:59 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-02-03 17:27:47 -0700 |
commit | 0b7b21e42ba2d6ac9595a4358a9354249605a3af (patch) | |
tree | 6c1554824b3b478daf422dac9c8fe98aa91026ba /fs | |
parent | f0b493e6b9a8959356983f57112229e69c2f7b8c (diff) | |
download | linux-0b7b21e42ba2d6ac9595a4358a9354249605a3af.tar.bz2 |
io_uring: use the proper helpers for io_send/recv
Don't use the recvmsg/sendmsg helpers, use the same helpers that the
recv(2) and send(2) system calls use.
Reported-by: 李通洲 <carter.li@eoitek.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 43f3b7d90299..cd07df2afe61 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3090,7 +3090,8 @@ static int io_send(struct io_kiocb *req, struct io_kiocb **nxt, else if (force_nonblock) flags |= MSG_DONTWAIT; - ret = __sys_sendmsg_sock(sock, &msg, flags); + msg.msg_flags = flags; + ret = sock_sendmsg(sock, &msg); if (force_nonblock && ret == -EAGAIN) return -EAGAIN; if (ret == -ERESTARTSYS) @@ -3116,6 +3117,7 @@ static int io_recvmsg_prep(struct io_kiocb *req, sr->msg_flags = READ_ONCE(sqe->msg_flags); sr->msg = u64_to_user_ptr(READ_ONCE(sqe->addr)); + sr->len = READ_ONCE(sqe->len); if (!io || req->opcode == IORING_OP_RECV) return 0; @@ -3234,7 +3236,7 @@ static int io_recv(struct io_kiocb *req, struct io_kiocb **nxt, else if (force_nonblock) flags |= MSG_DONTWAIT; - ret = __sys_recvmsg_sock(sock, &msg, NULL, NULL, flags); + ret = sock_recvmsg(sock, &msg, flags); if (force_nonblock && ret == -EAGAIN) return -EAGAIN; if (ret == -ERESTARTSYS) |