* [PATCH] socket: do a generic_file_splice_read when proto_ops has no splice_read
@ 2018-11-16 9:27 kaslevs
2018-11-18 5:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: kaslevs @ 2018-11-16 9:27 UTC (permalink / raw)
To: netdev; +Cc: davem
From: Slavomir Kaslev <kaslevs@vmware.com>
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 <kaslevs@vmware.com>
---
net/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/socket.c b/net/socket.c
index 593826e11a53..334fcc617ef2 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);
}
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] socket: do a generic_file_splice_read when proto_ops has no splice_read
2018-11-16 9:27 [PATCH] socket: do a generic_file_splice_read when proto_ops has no splice_read kaslevs
@ 2018-11-18 5:34 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-11-18 5:34 UTC (permalink / raw)
To: kaslevs; +Cc: netdev
From: kaslevs@vmware.com
Date: Fri, 16 Nov 2018 11:27:53 +0200
> From: Slavomir Kaslev <kaslevs@vmware.com>
>
> 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 <kaslevs@vmware.com>
Applied.
I wonder why we left things this way for so long.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-18 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-16 9:27 [PATCH] socket: do a generic_file_splice_read when proto_ops has no splice_read kaslevs
2018-11-18 5:34 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.