Skip to content

Commit 67178fd

Browse files
dhowellsaxboe
authored andcommitted
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 <[email protected]> cc: "David S. Miller" <[email protected]> cc: Eric Dumazet <[email protected]> cc: Jakub Kicinski <[email protected]> cc: Paolo Abeni <[email protected]> cc: Christoph Hellwig <[email protected]> cc: Al Viro <[email protected]> cc: Jens Axboe <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent b007273 commit 67178fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
10931093
struct socket *sock = file->private_data;
10941094

10951095
if (unlikely(!sock->ops->splice_read))
1096-
return generic_file_splice_read(file, ppos, pipe, len, flags);
1096+
return copy_splice_read(file, ppos, pipe, len, flags);
10971097

10981098
return sock->ops->splice_read(sock, ppos, pipe, len, flags);
10991099
}

0 commit comments

Comments
 (0)