diff options
| author | Jens Axboe <axboe@kernel.dk> | 2025-03-20 12:25:12 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-03-28 22:04:55 +0100 |
| commit | 7473c1e5159f0c94337a65a2b9973260f8154c11 (patch) | |
| tree | 47426282b666058cbd727c18051d4c1ef068c34b /io_uring | |
| parent | 6242772c9d9756bb5d5543b48cf5119772ad75cf (diff) | |
| download | linux-7473c1e5159f0c94337a65a2b9973260f8154c11.tar.gz linux-7473c1e5159f0c94337a65a2b9973260f8154c11.tar.bz2 linux-7473c1e5159f0c94337a65a2b9973260f8154c11.zip | |
io_uring/net: don't clear REQ_F_NEED_CLEANUP unconditionally
commit cc34d8330e036b6bffa88db9ea537bae6b03948f upstream.
io_req_msg_cleanup() relies on the fact that io_netmsg_recycle() will
always fully recycle, but that may not be the case if the msg cache
was already full. To ensure that normal cleanup always gets run,
let io_netmsg_recycle() deal with clearing the relevant cleanup flags,
as it knows exactly when that should be done.
Cc: stable@vger.kernel.org
Reported-by: David Wei <dw@davidwei.uk>
Fixes: 75191341785e ("io_uring/net: add iovec recycling")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/net.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index 96af3408792b..28688b6a3a50 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -151,7 +151,7 @@ static void io_netmsg_recycle(struct io_kiocb *req, unsigned int issue_flags) if (iov) kasan_mempool_poison_object(iov); req->async_data = NULL; - req->flags &= ~REQ_F_ASYNC_DATA; + req->flags &= ~(REQ_F_ASYNC_DATA|REQ_F_NEED_CLEANUP); } } @@ -453,7 +453,6 @@ int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) static void io_req_msg_cleanup(struct io_kiocb *req, unsigned int issue_flags) { - req->flags &= ~REQ_F_NEED_CLEANUP; io_netmsg_recycle(req, issue_flags); } |
