From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 769542ED143; Thu, 3 Jul 2025 15:11:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555515; cv=none; b=GfyyFrZPNHY4WR0bj1Lt0ysX9NEu29BnqwwYTV004yJcU7AbhoyKU1huQNrSk1HIkoxrrBn23Pg3+6PzEFtI8Smoh5vmHZTt+slZ8MuEBdJe9d1Pjp7pS8bNM0Kq70UOfAJL+KmD8ADuhOv82fY00lkz/ELdoTM8fGVHqr9YH/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555515; c=relaxed/simple; bh=q3c7+OqGsjdIFWkzmezD/uQOa7L1V+Bg4mbjZ+mxYoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aCJygcWjJHwN+nkhm+eJBQBPK9W+/bKsd/70g2ZyUNHfUeIQ3KjEiGR6zFXPdKntmHdJocvOqoPhh8bxVJpeZkVAzhDM4080NxZ1/UpStFcfTB+4F7A0p3+pzqIloBS/IlyvPtEC1JZneHd6HjhSPsjjKKbtiCN1bDkaJ/BrHS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vEievK2s; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vEievK2s" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEC5AC4CEE3; Thu, 3 Jul 2025 15:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751555515; bh=q3c7+OqGsjdIFWkzmezD/uQOa7L1V+Bg4mbjZ+mxYoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vEievK2sm3KdSHR2BY4dXmkLaOjSfnWpTAzUiIDAhvm5TnTxksvOIYd71iuUJcQ2g eEehfwKln5VFsatbYv++OJI4G1a/rqsPwXuV8SuW0nblaFULL1VBaYRJJuRmiBSCGR McHc9noGzm1oLwG6L0OHWw/mUekHV8CQbYwlkE3g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nikhil Jha , Chuck Lever , Anna Schumaker , Sasha Levin Subject: [PATCH 6.6 008/139] sunrpc: dont immediately retransmit on seqno miss Date: Thu, 3 Jul 2025 16:41:11 +0200 Message-ID: <20250703143941.504307874@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250703143941.182414597@linuxfoundation.org> References: <20250703143941.182414597@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nikhil Jha [ Upstream commit fadc0f3bb2de8c570ced6d9c1f97222213d93140 ] 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 Acked-by: Chuck Lever Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- net/sunrpc/clnt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 4ffb2bcaf3648..63756607f6327 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2733,8 +2733,13 @@ rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr) case -EPROTONOSUPPORT: goto out_err; case -EACCES: - /* Re-encode with a fresh cred */ - fallthrough; + /* possible RPCSEC_GSS out-of-sequence event (RFC2203), + * reset recv state and keep waiting, don't retransmit + */ + task->tk_rqstp->rq_reply_bytes_recvd = 0; + task->tk_status = xprt_request_enqueue_receive(task); + task->tk_action = call_transmit_status; + return -EBADMSG; default: goto out_garbage; } -- 2.39.5