Don't stop until we run out of data, or we hit an error.
Signed-off-by: Trond Myklebust <[email protected]>
---
net/sunrpc/xprtsock.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 30e7ac2..8bd3b0f 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1073,6 +1073,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
{
struct rpc_xprt *xprt;
read_descriptor_t rd_desc;
+ int read;
dprintk("RPC: xs_tcp_data_ready...\n");
@@ -1084,8 +1085,10 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
/* We use rd_desc to pass struct xprt to xs_tcp_data_recv */
rd_desc.arg.data = xprt;
- rd_desc.count = 65536;
- tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
+ do {
+ rd_desc.count = 65536;
+ read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
+ } while (read > 0);
out:
read_unlock(&sk->sk_callback_lock);
}
Trond Myklebust wrote:
> Don't stop until we run out of data, or we hit an error.
I don't understand how this patch is related to the others.
> Signed-off-by: Trond Myklebust <[email protected]>
> ---
>
> net/sunrpc/xprtsock.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index 30e7ac2..8bd3b0f 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -1073,6 +1073,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
> {
> struct rpc_xprt *xprt;
> read_descriptor_t rd_desc;
> + int read;
>
> dprintk("RPC: xs_tcp_data_ready...\n");
>
> @@ -1084,8 +1085,10 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
>
> /* We use rd_desc to pass struct xprt to xs_tcp_data_recv */
> rd_desc.arg.data = xprt;
> - rd_desc.count = 65536;
> - tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
> + do {
> + rd_desc.count = 65536;
> + read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
> + } while (read > 0);
Why are we looping instead of simply setting rd_desc.count to a larger
value (say, a megabyte)?
(If we keep this, it would be nice to replace the "65536" with a macro,
and to add a comment explaining the need for the loop).
> out:
> read_unlock(&sk->sk_callback_lock);
> }