summaryrefslogtreecommitdiff
path: root/fs/lockd
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2026-05-12 14:13:39 -0400
committerChuck Lever <cel@kernel.org>2026-06-09 16:32:59 -0400
commit2175ca75882e346c9d8741a2196693d70f635340 (patch)
tree9927877f881246e5d4fb2e95f273b49c3ad012c6 /fs/lockd
parent6d4c0dfeba728f2d06f634f02eb7606b82d87fbd (diff)
downloadlinux-next-2175ca75882e346c9d8741a2196693d70f635340.tar.gz
linux-next-2175ca75882e346c9d8741a2196693d70f635340.zip
lockd: Translate nlm__int__deadlock in __nlm4svc_proc_lock_msg()
When nlmsvc_lock() detects a deadlock it returns the internal sentinel nlm__int__deadlock (30001), which version-specific handlers must translate to a wire-valid status before the reply is encoded. The xdrgen LOCK_MSG handler stores the sentinel unmodified in resp->status; the LOCK_RES callback then places 30001 on the v4 wire, where the client rejects the reply. Commit 9e0d0c619407 ("lockd: Introduce nlm__int__deadlock") established the translation boundary and updated the synchronous v4 path nlm4svc_do_lock(), but the xdrgen LOCK_MSG handler added later in commit b2be4e28c23a ("lockd: Use xdrgen XDR functions for the NLMv4 LOCK_MSG procedure") missed the corresponding remap. Apply the same translation in __nlm4svc_proc_lock_msg() so deadlock results are reported as nlm4_deadlock on LOCK_RES. Fixes: b2be4e28c23a ("lockd: Use xdrgen XDR functions for the NLMv4 LOCK_MSG procedure") Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/svc4proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 2bd71bc2b481..886b56317e5f 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -668,6 +668,8 @@ __nlm4svc_proc_lock_msg(struct svc_rqst *rqstp, struct nlm_res *resp)
resp->status = nlmsvc_lock(rqstp, file, host, &argp->lock,
argp->xdrgen.block, &resp->cookie,
argp->xdrgen.reclaim);
+ if (resp->status == nlm__int__deadlock)
+ resp->status = nlm4_deadlock;
nlmsvc_release_lockowner(&argp->lock);
out: