Skip to contentSkip to conversation

server tcp performance patches

DISCUSSION J. Bruce Fields 1 participant 1 message Apr 10, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Quoted 1 line

I'm considering queueing this up for 2.6.40.

Done, but with the following fix.

--b.

commit 8985ef0b8af895c3b85a8c1b7108e0169fcbd20b

Author: J. Bruce Fields <[email protected]>
Date:   Sat Apr 9 10:03:10 2011 -0400

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.

net/sunrpc/svcsock.c +3 -4
index 213dea8..af04f77 100644
@@ -1143,11 +1143,8 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
 
 	p = (__be32 *)rqstp->rq_arg.head[0].iov_base;
 	calldir = p[1];
-	if (calldir) {
+	if (calldir)
 		len = receive_cb_reply(svsk, rqstp);
-		if (len < 0)
-			goto error;
-	}
 
 	/* Reset TCP read info */
 	svsk->sk_reclen = 0;
@@ -1156,6 +1153,8 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
 	if (svc_recv_available(svsk) > sizeof(rpc_fraghdr))
 		set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
 
+	if (len < 0)
+		goto error;
 
 	svc_xprt_copy_addrs(rqstp, &svsk->sk_xprt);
 	if (serv->sv_stats)