]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lockd: Use xdrgen XDR functions for the NLMv3 LOCK_RES procedure
authorChuck Lever <chuck.lever@oracle.com>
Tue, 12 May 2026 18:14:01 +0000 (14:14 -0400)
committerChuck Lever <cel@kernel.org>
Tue, 9 Jun 2026 20:32:59 +0000 (16:32 -0400)
Continue the xdrgen migration by converting NLMv3 LOCK_RES,
the callback that a remote NLM uses to return async LOCK
results to this lockd.  The procedure now uses
nlm_svc_decode_nlm_res and nlm_svc_encode_void, generated
from the NLM version 3 protocol specification.

Setting pc_argzero to zero is safe because the generated
decoder fills the argp->xdrgen subfields before the procedure
runs, so the zeroing memset performed by the dispatch layer
is no longer needed.

Setting pc_xdrressize to XDR_void reflects that LOCK_RES, as
a callback, returns no data; the previous value of St
over-reserved a status word in the reply buffer.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svcproc.c

index ed1164ff431a6ebc43d85fcec2f43d24e8924e4f..c86ba0b94793a76d9f8bd8afaa3e612b0b1381bc 100644 (file)
@@ -1280,15 +1280,15 @@ static const struct svc_procedure nlmsvc_procedures[24] = {
                .pc_xdrressize  = XDR_void,
                .pc_name        = "TEST_RES",
        },
-       [NLMPROC_LOCK_RES] = {
-               .pc_func = nlmsvc_proc_null,
-               .pc_decode = nlmsvc_decode_void,
-               .pc_encode = nlmsvc_encode_void,
-               .pc_argsize = sizeof(struct lockd_res),
-               .pc_argzero = sizeof(struct lockd_res),
-               .pc_ressize = sizeof(struct nlm_void),
-               .pc_xdrressize = St,
-               .pc_name = "LOCK_RES",
+       [NLM_LOCK_RES] = {
+               .pc_func        = nlmsvc_proc_null,
+               .pc_decode      = nlm_svc_decode_nlm_res,
+               .pc_encode      = nlm_svc_encode_void,
+               .pc_argsize     = sizeof(struct nlm_res),
+               .pc_argzero     = 0,
+               .pc_ressize     = 0,
+               .pc_xdrressize  = XDR_void,
+               .pc_name        = "LOCK_RES",
        },
        [NLMPROC_CANCEL_RES] = {
                .pc_func = nlmsvc_proc_null,