]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
nfsd: register pernet ops last, unregister first
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 3 Feb 2021 16:42:13 +0000 (11:42 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 15 Feb 2021 15:45:00 +0000 (10:45 -0500)
commitbd5ae9288d6451bd346a1b4a59d4fe7e62ba29b7
treecfd4aa968de1a917390212fa2f2890189f921c52
parentf40ddce88593482919761f74910f42f4b84c004b
nfsd: register pernet ops last, unregister first

These pernet operations may depend on stuff set up or torn down in the
module init/exit functions.  And they may be called at any time in
between.  So it makes more sense for them to be the last to be
registered in the init function, and the first to be unregistered in the
exit function.

In particular, without this, the drc slab is being destroyed before all
the per-net drcs are shut down, resulting in an "Objects remaining in
nfsd_drc on __kmem_cache_shutdown()" warning in exit_nfsd.

Reported-by: Zhi Li <yieli@redhat.com>
Fixes: 3ba75830ce17 "nfsd4: drc containerization"
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsctl.c