* [PATCH v2] io_uring/net: clear msg_controllen on partial sendmsg retry
@ 2023-06-20 13:19 Jens Axboe
2023-06-21 11:34 ` Stefan Metzmacher
0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2023-06-20 13:19 UTC (permalink / raw)
To: io-uring; +Cc: Stefan Metzmacher
If we have cmsg attached AND we transferred partial data at least, clear
msg_controllen on retry so we don't attempt to send that again.
Cc: [email protected] # 5.10+
Fixes: cac9e4418f4c ("io_uring/net: save msghdr->msg_control for retries")
Reported-by: Stefan Metzmacher <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
---
v2: clear msg_control as well
io_uring/net.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/io_uring/net.c b/io_uring/net.c
index 51b0f7fbb4f5..c0924ab1ea11 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -326,6 +326,8 @@ int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)
if (ret == -EAGAIN && (issue_flags & IO_URING_F_NONBLOCK))
return io_setup_async_msg(req, kmsg, issue_flags);
if (ret > 0 && io_net_retry(sock, flags)) {
+ kmsg->msg.msg_controllen = 0;
+ kmsg->msg.msg_control = NULL;
sr->done_io += ret;
req->flags |= REQ_F_PARTIAL_IO;
return io_setup_async_msg(req, kmsg, issue_flags);
--
2.39.2
--
Jens Axboe
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] io_uring/net: clear msg_controllen on partial sendmsg retry
2023-06-20 13:19 [PATCH v2] io_uring/net: clear msg_controllen on partial sendmsg retry Jens Axboe
@ 2023-06-21 11:34 ` Stefan Metzmacher
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Metzmacher @ 2023-06-21 11:34 UTC (permalink / raw)
To: Jens Axboe, io-uring
Am 20.06.23 um 15:19 schrieb Jens Axboe:
> If we have cmsg attached AND we transferred partial data at least, clear
> msg_controllen on retry so we don't attempt to send that again.
>
> Cc: [email protected] # 5.10+
> Fixes: cac9e4418f4c ("io_uring/net: save msghdr->msg_control for retries")
> Reported-by: Stefan Metzmacher <[email protected]>
> Signed-off-by: Jens Axboe <[email protected]>
Also Reviewed-by: Stefan Metzmacher <[email protected]>
> ---
>
> v2: clear msg_control as well
>
> io_uring/net.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/io_uring/net.c b/io_uring/net.c
> index 51b0f7fbb4f5..c0924ab1ea11 100644
> --- a/io_uring/net.c
> +++ b/io_uring/net.c
> @@ -326,6 +326,8 @@ int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)
> if (ret == -EAGAIN && (issue_flags & IO_URING_F_NONBLOCK))
> return io_setup_async_msg(req, kmsg, issue_flags);
> if (ret > 0 && io_net_retry(sock, flags)) {
> + kmsg->msg.msg_controllen = 0;
> + kmsg->msg.msg_control = NULL;
> sr->done_io += ret;
> req->flags |= REQ_F_PARTIAL_IO;
> return io_setup_async_msg(req, kmsg, issue_flags);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-21 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20 13:19 [PATCH v2] io_uring/net: clear msg_controllen on partial sendmsg retry Jens Axboe
2023-06-21 11:34 ` Stefan Metzmacher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox