Skip to content

Commit beaf139

Browse files
committed
Merge tag 'io_uring-6.0-2022-08-19' of git://git.kernel.dk/linux-block
Pull io_uring fixes from Jens Axboe: "A few fixes for regressions in this cycle: - Two instances of using the wrong "has async data" helper (Pavel) - Fixup zero-copy address import (Pavel) - Bump zero-copy notification slot limit (Pavel)" * tag 'io_uring-6.0-2022-08-19' of git://git.kernel.dk/linux-block: io_uring/net: use right helpers for async_data io_uring/notif: raise limit on notification slots io_uring/net: improve zc addr import error handling io_uring/net: use right helpers for async recycle
2 parents 044610f + 3f743e9 commit beaf139

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

io_uring/net.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static void io_netmsg_recycle(struct io_kiocb *req, unsigned int issue_flags)
116116
{
117117
struct io_async_msghdr *hdr = req->async_data;
118118

119-
if (!hdr || issue_flags & IO_URING_F_UNLOCKED)
119+
if (!req_has_async_data(req) || issue_flags & IO_URING_F_UNLOCKED)
120120
return;
121121

122122
/* Let normal cleanup path reap it if we fail adding to the cache */
@@ -152,9 +152,9 @@ static int io_setup_async_msg(struct io_kiocb *req,
152152
struct io_async_msghdr *kmsg,
153153
unsigned int issue_flags)
154154
{
155-
struct io_async_msghdr *async_msg = req->async_data;
155+
struct io_async_msghdr *async_msg;
156156

157-
if (async_msg)
157+
if (req_has_async_data(req))
158158
return -EAGAIN;
159159
async_msg = io_recvmsg_alloc_async(req, issue_flags);
160160
if (!async_msg) {
@@ -977,6 +977,14 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
977977
msg.msg_controllen = 0;
978978
msg.msg_namelen = 0;
979979

980+
if (zc->addr) {
981+
ret = move_addr_to_kernel(zc->addr, zc->addr_len, &address);
982+
if (unlikely(ret < 0))
983+
return ret;
984+
msg.msg_name = (struct sockaddr *)&address;
985+
msg.msg_namelen = zc->addr_len;
986+
}
987+
980988
if (zc->flags & IORING_RECVSEND_FIXED_BUF) {
981989
ret = io_import_fixed(WRITE, &msg.msg_iter, req->imu,
982990
(u64)(uintptr_t)zc->buf, zc->len);
@@ -992,14 +1000,6 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
9921000
return ret;
9931001
}
9941002

995-
if (zc->addr) {
996-
ret = move_addr_to_kernel(zc->addr, zc->addr_len, &address);
997-
if (unlikely(ret < 0))
998-
return ret;
999-
msg.msg_name = (struct sockaddr *)&address;
1000-
msg.msg_namelen = zc->addr_len;
1001-
}
1002-
10031003
msg_flags = zc->msg_flags | MSG_ZEROCOPY;
10041004
if (issue_flags & IO_URING_F_NONBLOCK)
10051005
msg_flags |= MSG_DONTWAIT;

io_uring/notif.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "rsrc.h"
99

1010
#define IO_NOTIF_SPLICE_BATCH 32
11-
#define IORING_MAX_NOTIF_SLOTS (1U << 10)
11+
#define IORING_MAX_NOTIF_SLOTS (1U << 15)
1212

1313
struct io_notif_data {
1414
struct file *file;

0 commit comments

Comments
 (0)