From: Slavomir Kaslev Date: Fri, 16 Nov 2018 09:27:53 +0000 (+0200) Subject: socket: do a generic_file_splice_read when proto_ops has no splice_read X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=95506588d2c1d72ca29adef8ae9bf771bcfb4ced;p=linux.git socket: do a generic_file_splice_read when proto_ops has no splice_read splice(2) fails with -EINVAL when called reading on a socket with no splice_read set in its proto_ops (such as vsock sockets). Switch this to fallbacks to a generic_file_splice_read instead. Signed-off-by: Slavomir Kaslev Signed-off-by: David S. Miller --- diff --git a/net/socket.c b/net/socket.c index 593826e11a537..334fcc617ef27 100644 --- a/net/socket.c +++ b/net/socket.c @@ -853,7 +853,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 -EINVAL; + return generic_file_splice_read(file, ppos, pipe, len, flags); return sock->ops->splice_read(sock, ppos, pipe, len, flags); }