From: Chuck Lever Date: Tue, 12 May 2026 18:14:03 +0000 (-0400) Subject: lockd: Use xdrgen XDR functions for the NLMv3 UNLOCK_RES procedure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e20aa949192712a362a35d863d35f5292b04555;p=thirdparty%2Fkernel%2Flinux.git lockd: Use xdrgen XDR functions for the NLMv3 UNLOCK_RES procedure Continue the xdrgen migration by converting NLMv3 UNLOCK_RES, the callback that a remote NLM uses to return async UNLOCK 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 UNLOCK_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 Signed-off-by: Chuck Lever --- diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c index e7d399afbe832..f17d3f8d85ecf 100644 --- a/fs/lockd/svcproc.c +++ b/fs/lockd/svcproc.c @@ -1300,15 +1300,15 @@ static const struct svc_procedure nlmsvc_procedures[24] = { .pc_xdrressize = XDR_void, .pc_name = "CANCEL_RES", }, - [NLMPROC_UNLOCK_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 = "UNLOCK_RES", + [NLM_UNLOCK_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 = "UNLOCK_RES", }, [NLMPROC_GRANTED_RES] = { .pc_func = nlmsvc_proc_granted_res,