]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFSD: convert callback RPC program to per-net namespace
authorDai Ngo <dai.ngo@oracle.com>
Fri, 13 Mar 2026 16:31:48 +0000 (12:31 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 3 Apr 2026 13:27:52 +0000 (09:27 -0400)
commit42cc13995967c1f3790cb106916eed8fab2a37b1
treec296f55d9d7351a111bddc06a97cef6a4e2b3610
parent39bd1bfe92a1a9450e1d6397f845020581090836
NFSD: convert callback RPC program to per-net namespace

The callback channel's rpc_program, rpc_version, rpc_stat,
and per-procedure counts are declared as file-scope statics in
nfs4callback.c, shared across all network namespaces.
Forechannel RPC statistics are already maintained per-netns
(via nfsd_svcstats in struct nfsd_net); the backchannel
has no such separation. When backchannel statistics are
eventually surfaced to userspace, the global counters would
expose cross-namespace data.

Allocate per-netns copies of these structures through a new
opaque struct nfsd_net_cb, managed by nfsd_net_cb_init()
and nfsd_net_cb_shutdown(). The struct definition is private
to nfs4callback.c; struct nfsd_net holds only a pointer.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/netns.h
fs/nfsd/nfs4callback.c
fs/nfsd/nfsctl.c
fs/nfsd/state.h