Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347702
b: refs/heads/master
c: ad46ccf
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Dec 4, 2012
1 parent 781f510 commit 12e12e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc248d4b1ddf05fefc1373d9d7a4dd1df71b6190
refs/heads/master: ad46ccf09440975618e8fc1ead53d0a27b9bcf4c
16 changes: 7 additions & 9 deletions trunk/net/sunrpc/svcsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,8 @@ static void svc_tcp_clear_pages(struct svc_sock *svsk)
}

/*
* Receive data.
* Receive fragment record header.
* If we haven't gotten the record length yet, get the next four bytes.
* Otherwise try to gobble up as much as possible up to the complete
* record length.
*/
static int svc_tcp_recv_record(struct svc_sock *svsk, struct svc_rqst *rqstp)
{
Expand Down Expand Up @@ -968,9 +966,6 @@ static int svc_tcp_recv_record(struct svc_sock *svsk, struct svc_rqst *rqstp)
}
}

if (svc_sock_reclen(svsk) < 8)
goto err_delete; /* client is nuts. */

return svc_sock_reclen(svsk);
error:
dprintk("RPC: TCP recv_record got %d\n", len);
Expand Down Expand Up @@ -1076,12 +1071,15 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
if (len != want) {
svc_tcp_save_pages(svsk, rqstp);
if (len < 0 && len != -EAGAIN)
goto err_other;
goto err_delete;
dprintk("svc: incomplete TCP record (%d of %d)\n",
svsk->sk_tcplen, svc_sock_reclen(svsk));
goto err_noclose;
}

if (svc_sock_reclen(svsk) < 8)
goto err_delete; /* client is nuts. */

rqstp->rq_arg.len = svc_sock_reclen(svsk);
rqstp->rq_arg.page_base = 0;
if (rqstp->rq_arg.len <= rqstp->rq_arg.head[0].iov_len) {
Expand Down Expand Up @@ -1117,10 +1115,10 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)

error:
if (len != -EAGAIN)
goto err_other;
goto err_delete;
dprintk("RPC: TCP recvfrom got EAGAIN\n");
return 0;
err_other:
err_delete:
printk(KERN_NOTICE "%s: recvfrom returned errno %d\n",
svsk->sk_xprt.xpt_server->sv_name, -len);
set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags);
Expand Down

0 comments on commit 12e12e5

Please sign in to comment.