summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-08-12 17:48:53 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-08-12 17:48:53 -0700
commitdfc3997c05d92b4b4e0cadfd9e2a577fd16e0056 (patch)
tree52ed53891adfb583a4a8e339df4810eab5520a5d
parentd5300a3a14c316c21fd746753cc701a544212c29 (diff)
[PATCH] PATCH - RPC/TCP 4 of 4 - Handle short read when reading RPC/TCP packet length
The code already copes with the possibility of having read some of the 4byte length but not all, but can never get into that situation. We just need to add a 'return' for the case where read got some data but not enough. Either 0 or -EAGAIN could be returned, they both have the same effect.
-rw-r--r--net/sunrpc/svcsock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index ea15fcb2648e..ab28937c1dcd 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -811,6 +811,9 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
goto error;
svsk->sk_tcplen += len;
+ if (len < want)
+ return 0;
+
svsk->sk_reclen = ntohl(svsk->sk_reclen);
if (!(svsk->sk_reclen & 0x80000000)) {
/* FIXME: technically, a record can be fragmented,