From: Christoph Engelbert Date: Tue, 01 Dec 2026 15:18:36 +0100 Subject: [PATCH 2/4] NFSv4.1: retry a LAYOUTCOMMIT refused with NFS4ERR_GRACE MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261201-pnfs-layoutcommit-reclaim-nfs-testing-v1-2-d2b7dff70c94@noctarius.com> References: <20261201-pnfs-layoutcommit-reclaim-nfs-testing-v1-0-d2b7dff70c94@noctarius.com> In-Reply-To: <20261201-pnfs-layoutcommit-reclaim-nfs-testing-v1-0-d2b7dff70c94@noctarius.com> To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, Benjamin Coddington , Christoph Hellwig , Chuck Lever , Christoph Engelbert X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1533; i=me@noctarius.com; h=from:subject:message-id; bh=/qVVfOVL3ByXXC1JsA3pGC/8blspNree0d/rkG4DBx4=; b=owEBiQJ2/ZANAwAIAVhbnBNI3YM5AcsmYgBrDtdDqsequfSm20wUxcAaxltNye/KLWkv6pgdr VfgtNVbCa2JAk8EAAEIADkWIQS7rwhH2diBc7a5gYtYW5wTSN2DOQUCaw7XQxsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwwLDMACgkQWFucE0jdgzmfNA/+OaudvRrRbLOwijGQqmlQlwUegrW/VTp EhPLj7qE/hstT7upE6XwUGVW25oixywzZfcYw57vqFdT+0Cb8KQGiOYd0ebXHDgFY80nU3R4GnU L/DFE0Layd06S/Lea4FnYm2Q/Zn4iRbK5dLwTfWsMcidAnwK+yUiMTz0s4Ce0QYTILeAMLLg7ME KkK8nM7MAGD1m2OmJXXsY5K2sS4Iq00DkgZbZ7TzjAmIc1KvohPTeTGL6i2YX5QjsnrN4OQaiwZ jpze+dXdWvPqgs9+TNJnWYNLGxl7J2z+rIThGDl8g24ZWZWemYoY+22HAHB0/0lJrb1R8bK5Vgy aUFyjK+MP+nyyjKMFgMnsX7nMWl1ITC5udBRxrqy0GRLQEml1id2LB+TGNYSH1jiP4zQAKPDiCA ShQwgNcoCIVZp+ZCX93/JIyRulFW8VsOuAkw7omGfmfWbNAC+kJSL6Mutod7+acgussiQoIHEWs G1M5u/bahaL43mn63IP6JjOtE6ZpB9xtmyb3lGIA5yOzkMdZy2x6bma8RDqedLs6iPC2alpHGHA SJRbamh4rgVngkPFBqY1ZtQEtb4KNe49MnoXBGIiFW5ZEVDUt5BhlhFH0qmWy9uwV40dA6diGnP VUrxwBQDDW0M3XeV3hiHiEawqLt19JGdXtsdu1JsEFw8zf84pEjQ= X-Developer-Key: i=me@noctarius.com; a=openpgp; fpr=BBAF0847D9D88173B6B9818B585B9C1348DD8339 X-Endpoint-Received: by B4 Relay for me@noctarius.com/default with auth_id=1712 List-Id: B4 Relay Submissions A server in its grace period refuses a LAYOUTCOMMIT that does not set loca_reclaim with NFS4ERR_GRACE. nfs4_layoutcommit_done() ignores that error, so the commit is never sent again. Commit f770d34f7112 ("pnfs/blocklayout: report data lost to a failed LAYOUTCOMMIT") made the block layout put the extents back and record -EIO, so fsync() and close() now fail for data that a commit after the grace period would have recorded. Before that commit, they returned 0 while the server still had the blocks as unwritten. NFS4ERR_GRACE asks the client to try again later, so take the generic error path, which delays and retries the commit as it does for NFS4ERR_DELAY. A commit of a layout granted before the restart is sent as a reclaim by the state manager before the grace period ends. Fixes: e59d27e05a64 ("NFSv4.1: Fix layoutcommit error handling") Signed-off-by: Christoph Engelbert --- fs/nfs/nfs4proc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index bea74c922655..ea7bf329771e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -10089,7 +10089,6 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata) case -NFS4ERR_DELEG_REVOKED: /* layout was recalled */ case -NFS4ERR_BADIOMODE: /* no IOMODE_RW layout for range */ case -NFS4ERR_BADLAYOUT: /* no layout */ - case -NFS4ERR_GRACE: /* loca_recalim always false */ task->tk_status = 0; break; case -NFS4ERR_OLD_STATEID: { -- Git-157)