]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
NFSv4: Retry LOCK on OLD_STATEID during delegation return
authorBenjamin Coddington <bcodding@redhat.com>
Wed, 19 Oct 2022 16:09:18 +0000 (12:09 -0400)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 12:59:26 +0000 (13:59 +0100)
commit9d017e5fcb3bb467bcfd3fc74b59d2273f034c2e
tree2fadb89b06828dec76f172180d7a4fef6cad4d93
parent957827a1f8eb4e5a6551119050a2aefae6a38675
NFSv4: Retry LOCK on OLD_STATEID during delegation return

[ Upstream commit f5ea16137a3fa2858620dc9084466491c128535f ]

There's a small window where a LOCK sent during a delegation return can
race with another OPEN on client, but the open stateid has not yet been
updated.  In this case, the client doesn't handle the OLD_STATEID error
from the server and will lose this lock, emitting:
"NFS: nfs4_handle_delegation_recall_error: unhandled error -10024".

Fix this by sending the task through the nfs4 error handling in
nfs4_lock_done() when we may have to reconcile our stateid with what the
server believes it to be.  For this case, the result is a retry of the
LOCK operation with the updated stateid.

Reported-by: Gonzalo Siero Humet <gsierohu@redhat.com>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 8a03a4a5cf6ddf75b8d7cd72b31702ec2ae0ad09)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
fs/nfs/nfs4proc.c