From: Sarah Martin Date: Fri, 04 Dec 2026 16:05:28 -0800 Subject: [PATCH] FFLOOS: expect NFS4_OK for a LAYOUTRETURN within VALID_SEQID_RANGE MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261204-ffloos-valid-seqid-range-v1-1-9fac972b3f8b@hammerspace.com> X-B4-Tracking: v=1; b=H4sIAEdVE2sC/yWM2wrCMBBEf6Xss8G2EBF/RXzIZdOu1ER32yKU/ rub+jJwhjOzgSATCtyaDRhXEipZoTs1EEaXBzQUlaFv+0unYVKaShGzuomiEfxo8uG10drQ2ZS u0YHO34yJvsf1/fFnWfwTw1z/quGdoPG6DmOtCtNA+fxyMiPDvv8ArPQ7Q5wAAAA= X-Change-ID: 20261202-ffloos-valid-seqid-range-0d55c15ff8da To: jlayton@kernel.org, calum.mackay@cdmnet.org, cel@kernel.org Cc: linux-nfs@vger.kernel.org, Sarah Martin X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796429128; l=2907; i=sarah.martin@hammerspace.com; s=20261202; h=from:subject:message-id; bh=7M9+8hHQHAPurn7GIyE2VcqrAfFv+iTWRkyLZwmeo8I=; b=9L+gc1e1m9m8i9u7cVc8XkZFwZ3QySN2QqIkvYNjupng8oJoPgF7aK5RL2aJ4zde1ernNZkOj keOrtRia9pfBHELM3ymSDQZMVdgC8PA2cbQT8N+kzq9VSEmydEXZqRW X-Developer-Key: i=sarah.martin@hammerspace.com; a=ed25519; pk=V3QbI7NvfMD8qgjho19qscB/3wpW+8BlAQk3hyLsXVU= X-Endpoint-Received: by B4 Relay for sarah.martin@hammerspace.com/20261202 with auth_id=1724 List-Id: B4 Relay Submissions testFlexLayoutOldSeqid sends a LAYOUTRETURN with seqid 1 when the server's current seqid is 3, and requires NFS4ERR_OLD_STATEID. RFC 8881 section 12.5.5.2.1.1 says: "It is permissible for the client to send multiple parallel LAYOUTGET operations for the same file or multiple parallel LAYOUTRETURN operations for the same file or a mix of both." Section 12.5.5.2.1.4 says what that means for the seqid: "If the client is sending multiple layout operations to the server in parallel, by definition, the "seqid" value in the supplied stateid will not be the current "seqid" as held by the server. The range of parallelism spans from the highest or current "seqid" to a "seqid" value in the past." It defines VALID_SEQID_RANGE = SERVER_CURRENT_SEQID - PAST_SEQID, where PAST_SEQID is the lowest acceptable seqid, and requires a minimum range of the sum of (ca_maxoperations - 1) over the client's sessions. The test's create_file COMPOUND has at least 4 operations, so the range is at least 3 and seqid 1 is inside it. The range check does not distinguish LAYOUTGET from LAYOUTRETURN, and the test already expects NFS4_OK for a LAYOUTGET with seqid 1. Section 18.44.3 describes one case for an error inside the range: "NFS4ERR_OLD_STATEID can be returned if the client is using an old seqid, and the server knows the client should not be using the old seqid." Its example is a slot being reused with an old seqid, which is how this test sends its requests. But the error is optional ("can"), and applies only if "the server knows". The seqid alone does not tell the server whether the client is stale or sending in parallel. It would have to track the layout seqid returned on each slot, which the RFC does not require. The default is the range check, which gives NFS4_OK. Signed-off-by: Sarah Martin --- nfs4.1/server41tests/st_flex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py index 766b213..4f13066 100644 --- a/nfs4.1/server41tests/st_flex.py +++ b/nfs4.1/server41tests/st_flex.py @@ -158,7 +158,7 @@ def testFlexLayoutOldSeqid(t, env): layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, empty_p.get_buffer())))] res = sess.compound(ops) - check(res, NFS4ERR_OLD_STATEID, "LAYOUTRETURN with an old stateid") + check(res, NFS4_OK, "LAYOUTRETURN with an old seqid within VALID_SEQID_RANGE") ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, --- base-commit: e315fb80532a0d304d5abc8b5cd2801c00a4fe4e change-id: 20261202-ffloos-valid-seqid-range-0d55c15ff8da Best regards, -- Sarah Martin