Skip to content

Commit 05a4b58

Browse files
daimngochucklever
authored andcommitted
SUNRPC: remove printk when back channel request not found
If the client interface is down, or there is a network partition between the client and server that prevents the callback request to reach the client, TCP on the server will keep re-transmitting the callback for about ~9 minutes before giving up and closing the connection. If the connection between the client and the server is re-established before the connection is closed and after the callback timed out (9 secs) then the re-transmitted callback request will arrive at the client. When the server receives the reply of the callback, receive_cb_reply prints the "Got unrecognized reply..." message in the system log since the callback request was already removed from the server xprt's recv_queue. Even though this scenario has no effect on the server operation, a malfunctioning or malicious client can fill up the server's system log. Signed-off-by: Dai Ngo <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent d3dba53 commit 05a4b58

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

net/sunrpc/svcsock.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,18 +1049,14 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp)
10491049
struct rpc_rqst *req = NULL;
10501050
struct kvec *src, *dst;
10511051
__be32 *p = (__be32 *)rqstp->rq_arg.head[0].iov_base;
1052-
__be32 xid;
1053-
__be32 calldir;
1054-
1055-
xid = *p++;
1056-
calldir = *p;
1052+
__be32 xid = *p;
10571053

10581054
if (!bc_xprt)
10591055
return -EAGAIN;
10601056
spin_lock(&bc_xprt->queue_lock);
10611057
req = xprt_lookup_rqst(bc_xprt, xid);
10621058
if (!req)
1063-
goto unlock_notfound;
1059+
goto unlock_eagain;
10641060

10651061
memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf));
10661062
/*
@@ -1077,12 +1073,6 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp)
10771073
rqstp->rq_arg.len = 0;
10781074
spin_unlock(&bc_xprt->queue_lock);
10791075
return 0;
1080-
unlock_notfound:
1081-
printk(KERN_NOTICE
1082-
"%s: Got unrecognized reply: "
1083-
"calldir 0x%x xpt_bc_xprt %p xid %08x\n",
1084-
__func__, ntohl(calldir),
1085-
bc_xprt, ntohl(xid));
10861076
unlock_eagain:
10871077
spin_unlock(&bc_xprt->queue_lock);
10881078
return -EAGAIN;

0 commit comments

Comments
 (0)