]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lockd: Have nlm_fopen() return errno values
authorChuck Lever <chuck.lever@oracle.com>
Wed, 28 Jan 2026 15:19:25 +0000 (10:19 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
commit7db001e03d7a668ca6c3789fee42a24236ca90f6
treef1f0af79ab0bede6ab27319714c98dc53d5343b6
parent9e0d0c61940796893e0c2200cdc7be0684218238
lockd: Have nlm_fopen() return errno values

The nlm_fopen() function is part of the API between nfsd and lockd.

Currently its return value is an on-the-wire NLM status code. But
that forces NFSD to include NLM wire protocol definitions despite
having no other dependency on the NLM wire protocol.

In addition, a CONFIG_LOCKD_V4 Kconfig symbol appears in the middle
of NFSD source code.

Refactor: Let's not use on-the-wire values as part of a high-level
API between two Linux kernel modules. That's what we have errno for,
right?

And, instead of simply moving the CONFIG_LOCKD_V4 check, we can get
rid of it entirely and let the decision of what actual NLM status
code goes on the wire to be left up to NLM version-specific code.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svc4proc.c
fs/lockd/svcproc.c
fs/lockd/svcsubs.c
fs/nfsd/lockd.c
include/linux/lockd/bind.h
include/linux/lockd/lockd.h