aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-04-09 10:03:10 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-04-10 10:47:46 -0400
commit8985ef0b8af895c3b85a8c1b7108e0169fcbd20b (patch)
tree0e71ed0ca7c913b435a291cb975cd5f4f58809b8 /net
parentd6c558379abc27241c75b8c30fc8c94b82537d5e (diff)
svcrpc: complete svsk processing on cb receive failure
Currently when there's some failure to receive a callback (because we couldn't find a matching xid, for example), we exit svc_recv with sk_tcplen still set but without any pages saved with the socket. This will cause a crash later in svc_tcp_restore_pages. Instead, make sure we reset that tcp information whether the callback received failed or succeeded. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 213dea8b283c..af04f779ce9f 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1143,11 +1143,8 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
1143 1143
1144 p = (__be32 *)rqstp->rq_arg.head[0].iov_base; 1144 p = (__be32 *)rqstp->rq_arg.head[0].iov_base;
1145 calldir = p[1]; 1145 calldir = p[1];
1146 if (calldir) { 1146 if (calldir)
1147 len = receive_cb_reply(svsk, rqstp); 1147 len = receive_cb_reply(svsk, rqstp);
1148 if (len < 0)
1149 goto error;
1150 }
1151 1148
1152 /* Reset TCP read info */ 1149 /* Reset TCP read info */
1153 svsk->sk_reclen = 0; 1150 svsk->sk_reclen = 0;
@@ -1156,6 +1153,8 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
1156 if (svc_recv_available(svsk) > sizeof(rpc_fraghdr)) 1153 if (svc_recv_available(svsk) > sizeof(rpc_fraghdr))
1157 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); 1154 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
1158 1155
1156 if (len < 0)
1157 goto error;
1159 1158
1160 svc_xprt_copy_addrs(rqstp, &svsk->sk_xprt); 1159 svc_xprt_copy_addrs(rqstp, &svsk->sk_xprt);
1161 if (serv->sv_stats) 1160 if (serv->sv_stats)