summaryrefslogtreecommitdiffstats
path: root/include/net/inet_common.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-06-07 19:19:13 +0100
committerJakub Kicinski <kuba@kernel.org>2023-06-08 19:40:30 -0700
commit1d7e4538a5463faa0b0e26a7a7b6bd68c7dfdd78 (patch)
tree0d539d1a13f203d607446b9163791db0ad7cab5c /include/net/inet_common.h
parentd4c1e80b0d1bacbbca5184f122b9893c5920c598 (diff)
downloadlinux-stable-1d7e4538a5463faa0b0e26a7a7b6bd68c7dfdd78.tar.gz
linux-stable-1d7e4538a5463faa0b0e26a7a7b6bd68c7dfdd78.tar.bz2
linux-stable-1d7e4538a5463faa0b0e26a7a7b6bd68c7dfdd78.zip
ipv4, ipv6: Use splice_eof() to flush
Allow splice to undo the effects of MSG_MORE after prematurely ending a splice/sendfile due to getting an EOF condition (->splice_read() returned 0) after splice had called sendmsg() with MSG_MORE set when the user didn't set MSG_MORE. For UDP, a pending packet will not be emitted if the socket is closed before it is flushed; with this change, it be flushed by ->splice_eof(). For TCP, it's not clear that MSG_MORE is actually effective. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/ Signed-off-by: David Howells <dhowells@redhat.com> cc: Kuniyuki Iwashima <kuniyu@amazon.com> cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com> cc: David Ahern <dsahern@kernel.org> cc: Jens Axboe <axboe@kernel.dk> cc: Matthew Wilcox <willy@infradead.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/inet_common.h')
-rw-r--r--include/net/inet_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 77f4b0ef5b92..a75333342c4e 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -35,6 +35,7 @@ void __inet_accept(struct socket *sock, struct socket *newsock,
struct sock *newsk);
int inet_send_prepare(struct sock *sk);
int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size);
+void inet_splice_eof(struct socket *sock);
ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
size_t size, int flags);
int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,