]> git.baikalelectronics.ru Git - kernel.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)
commit375b1e5b9c8008bf3d45abd39b59943cd2e742a7
treecfd4aa968de1a917390212fa2f2890189f921c52
parent85e28dbd98d995cf6c7079d7a33e25c4d197c57e
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: 6e14cdb51cea "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