io_uring-6.0-2022-08-19

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmL/xNUQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpof2D/0Vd8rLPdF20aaZgYnII47uhzWWCJDnMh/f
 3eV5EgLceIK/ByoGn+0+e/lDHDGQbtUqihuIDCJztf9WRCO5dOSyHIncEoyG4hUY
 zIXPHl6pOmTU0vSfJubi/v+oJviYp9NsKIbmKonv5zNYw9iu77wfskMKvPJvZpKR
 LZJIkSIaenPFGboDHMSIIXzEHnoF4th/HDePNHtAK6sAqVVy5B22PWWOlZSfKYOa
 Lu/MotmM3BBShFneTXWdqmP7at3F84wGq1o8M1Vfgy+/VFWDXQmfqHEcJw9DuTtI
 BYwvjiEuiOCinmlYJJMPC8P4ZgolB23LSnL1QnkVN2XSxKgdnsNBQuib83+QLfmn
 XykBDiPXl+0TfSUjgPxx5grxY4b3JJvFIZftmwgdbxttno8R+ZykP1c3fuOiQopR
 0dp4aR08SH85gQiVoH4qKAUjzEMxtrxNaFZo49TO0y56ivfZ864C07aQFPV3cwND
 aqLFmMG/4zY+YBFnj3nJMXMwAV3goDV6eJs9qGkTah9zntYS3yoCXVK3DFuwqJCN
 gEil09hn2omt1g4jNZyimpPPgcpM4CqpekHzxFVTyMM8i705thIZo5qveTJYh0vq
 vLZsk8QVArCzW2V4TibeR/S3C35/RWsa+QF2BvFhQW8hpoJueXVSQZ5djc4Zpq8w
 As1Vbx9CKQ==
 =hsdA
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2022-08-20 09:49:22 -07:00
commit beaf139709
2 changed files with 12 additions and 12 deletions

View file

@ -116,7 +116,7 @@ static void io_netmsg_recycle(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_async_msghdr *hdr = req->async_data;
if (!hdr || issue_flags & IO_URING_F_UNLOCKED)
if (!req_has_async_data(req) || issue_flags & IO_URING_F_UNLOCKED)
return;
/* 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,
struct io_async_msghdr *kmsg,
unsigned int issue_flags)
{
struct io_async_msghdr *async_msg = req->async_data;
struct io_async_msghdr *async_msg;
if (async_msg)
if (req_has_async_data(req))
return -EAGAIN;
async_msg = io_recvmsg_alloc_async(req, issue_flags);
if (!async_msg) {
@ -977,6 +977,14 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
msg.msg_controllen = 0;
msg.msg_namelen = 0;
if (zc->addr) {
ret = move_addr_to_kernel(zc->addr, zc->addr_len, &address);
if (unlikely(ret < 0))
return ret;
msg.msg_name = (struct sockaddr *)&address;
msg.msg_namelen = zc->addr_len;
}
if (zc->flags & IORING_RECVSEND_FIXED_BUF) {
ret = io_import_fixed(WRITE, &msg.msg_iter, req->imu,
(u64)(uintptr_t)zc->buf, zc->len);
@ -992,14 +1000,6 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
return ret;
}
if (zc->addr) {
ret = move_addr_to_kernel(zc->addr, zc->addr_len, &address);
if (unlikely(ret < 0))
return ret;
msg.msg_name = (struct sockaddr *)&address;
msg.msg_namelen = zc->addr_len;
}
msg_flags = zc->msg_flags | MSG_ZEROCOPY;
if (issue_flags & IO_URING_F_NONBLOCK)
msg_flags |= MSG_DONTWAIT;

View file

@ -8,7 +8,7 @@
#include "rsrc.h"
#define IO_NOTIF_SPLICE_BATCH 32
#define IORING_MAX_NOTIF_SLOTS (1U << 10)
#define IORING_MAX_NOTIF_SLOTS (1U << 15)
struct io_notif_data {
struct file *file;