SUNRPC: Ensure that we read all available tcp data

Don't stop until we run out of data, or we hit an error.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Trond Myklebust 2008-02-25 21:40:51 -08:00
parent f5fb7b06e4
commit ff2d7db848

View file

@ -1073,6 +1073,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
{ {
struct rpc_xprt *xprt; struct rpc_xprt *xprt;
read_descriptor_t rd_desc; read_descriptor_t rd_desc;
int read;
dprintk("RPC: xs_tcp_data_ready...\n"); 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 */ /* We use rd_desc to pass struct xprt to xs_tcp_data_recv */
rd_desc.arg.data = xprt; rd_desc.arg.data = xprt;
rd_desc.count = 65536; do {
tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv); rd_desc.count = 65536;
read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
} while (read > 0);
out: out:
read_unlock(&sk->sk_callback_lock); read_unlock(&sk->sk_callback_lock);
} }