summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-02-26 06:40:51 +0100
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-02-29 08:26:27 +0100
commitff2d7db848f8db7cade39e55f78f86d77e0de01a (patch)
treefb40ecbcad821ec6e31f4324c0483e13242f36c7 /net
parentSUNRPC: Eliminate the now-redundant rpc_start_wakeup() (diff)
downloadlinux-ff2d7db848f8db7cade39e55f78f86d77e0de01a.tar.xz
linux-ff2d7db848f8db7cade39e55f78f86d77e0de01a.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprtsock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 30e7ac243a90..8bd3b0f73ac0 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);
}