From: David Howells Date: Mon, 22 May 2023 13:50:00 +0000 (+0100) Subject: net: Make sock_splice_read() use copy_splice_read() by default X-Git-Tag: v6.6.7~2609^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67178fd066d53d5a6cada1cdc6399d02b68b708e;p=platform%2Fkernel%2Flinux-starfive.git net: Make sock_splice_read() use copy_splice_read() by default Make sock_splice_read() use copy_splice_read() by default as file_splice_read() will return immediately with 0 as a socket has no pagecache and is a zero-size file. Signed-off-by: David Howells cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: netdev@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20230522135018.2742245-14-dhowells@redhat.com Signed-off-by: Jens Axboe --- diff --git a/net/socket.c b/net/socket.c index b7e01d0..4017783 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1093,7 +1093,7 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos, struct socket *sock = file->private_data; if (unlikely(!sock->ops->splice_read)) - return generic_file_splice_read(file, ppos, pipe, len, flags); + return copy_splice_read(file, ppos, pipe, len, flags); return sock->ops->splice_read(sock, ppos, pipe, len, flags); }