Skip to content

Commit fadc0f3

Browse files
njha-jsAnna Schumaker
authored andcommitted
sunrpc: don't immediately retransmit on seqno miss
RFC2203 requires that retransmitted messages use a new gss sequence number, but the same XID. This means that if the server is just slow (e.x. overloaded), the client might receive a response using an older seqno than the one it has recorded. Currently, Linux's client immediately retransmits in this case. However, this leads to a lot of wasted retransmits until the server eventually responds faster than the client can resend. Client -> SEQ 1 -> Server Client -> SEQ 2 -> Server Client <- SEQ 1 <- Server (misses, expecting seqno = 2) Client -> SEQ 3 -> Server (immediate retransmission on miss) Client <- SEQ 2 <- Server (misses, expecting seqno = 3) Client -> SEQ 4 -> Server (immediate retransmission on miss) ... and so on ... This commit makes it so that we ignore messages with bad checksums due to seqnum mismatch, and rely on the usual timeout behavior for retransmission instead of doing so immediately. Signed-off-by: Nikhil Jha <[email protected]> Acked-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 08d6ee6 commit fadc0f3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

net/sunrpc/clnt.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,8 +2771,13 @@ rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr)
27712771
case -EPROTONOSUPPORT:
27722772
goto out_err;
27732773
case -EACCES:
2774-
/* Re-encode with a fresh cred */
2775-
fallthrough;
2774+
/* possible RPCSEC_GSS out-of-sequence event (RFC2203),
2775+
* reset recv state and keep waiting, don't retransmit
2776+
*/
2777+
task->tk_rqstp->rq_reply_bytes_recvd = 0;
2778+
task->tk_status = xprt_request_enqueue_receive(task);
2779+
task->tk_action = call_transmit_status;
2780+
return -EBADMSG;
27762781
default:
27772782
goto out_garbage;
27782783
}

0 commit comments

Comments
 (0)