All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: NeilBrown <neil@brown.name>, Jeff Layton <jlayton@kernel.org>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>, Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v3 4/5] NFSD: Increase minimum size of slot replay cache
Date: Fri, 10 Oct 2025 09:56:22 -0400	[thread overview]
Message-ID: <20251010135623.1723-5-cel@kernel.org> (raw)
In-Reply-To: <20251010135623.1723-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

NFSD caches solo SEQUENCE even when sa_cachethis is false. Ensure
there is enough space in each slot replay cache, even when the
client requested a zero ca_maxresponsesize_cached.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/nfs4state.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7b80f00fb32c..7d297ac2bf2b 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2024,11 +2024,12 @@ static struct nfsd4_slot *nfsd4_alloc_slot(struct nfsd4_channel_attrs *fattrs,
 	size_t size;
 
 	/*
-	 * The RPC and NFS session headers are never saved in
-	 * the slot reply cache buffer.
+	 * Reserve enough space to handle solo SEQUENCE operations,
+	 * which are always cached.
 	 */
 	size = fattrs->maxresp_cached < NFSD_MIN_HDR_SEQ_SZ ?
-		0 : fattrs->maxresp_cached - NFSD_MIN_HDR_SEQ_SZ;
+		NFSD_MIN_HDR_SEQ_SZ :
+		fattrs->maxresp_cached - NFSD_MIN_HDR_SEQ_SZ;
 
 	slot = kzalloc(struct_size(slot, sl_data, size), gfp);
 	if (!slot)
-- 
2.51.0


  parent reply	other threads:[~2025-10-10 13:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 13:56 [PATCH v3 0/5] Fix unwanted memory overwrites Chuck Lever
2025-10-10 13:56 ` [PATCH v3 1/5] NFSD: Skip close replay processing if XDR encoding fails Chuck Lever
2025-10-10 13:56 ` [PATCH v3 2/5] NFSD: Fix the "is this a solo SEQUENCE" predicate Chuck Lever
2025-10-11  0:26   ` NeilBrown
2025-10-10 13:56 ` [PATCH v3 3/5] nfsd: Never cache a COMPOUND when the SEQUENCE operation fails Chuck Lever
2025-10-10 15:19   ` Jeff Layton
2025-10-11  0:38   ` NeilBrown
2025-10-10 13:56 ` Chuck Lever [this message]
2025-10-10 15:22   ` [PATCH v3 4/5] NFSD: Increase minimum size of slot replay cache Jeff Layton
2025-10-11  0:04   ` NeilBrown
2025-10-10 13:56 ` [PATCH v3 5/5] NFSD: Move nfsd4_cache_this() Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251010135623.1723-5-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.