nfsd: shut down the NFSv4 state objects before the filecache
Subsystems (2)
Jeff Layton
maintainerPATCH 1/1 nfsd: shut down the NFSv4 state objects before the filecache
Currently, we shut down the filecache before trying to clean up the stateids that depend on it. This leads to the kernel trying to free an nfsd_file twice, and a refcount overput on the nf_mark.
Change the shutdown procedure to tear down all of the stateids prior to shutting down the filecache.
--- fs/nfsd/nfssvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfssvc.c +1 -1
@@ -453,8 +453,8 @@ static void nfsd_shutdown_net(struct net *net) {struct nfsd_net *nn =net_generic (net, nfsd_net_id); -nfsd_file_cache_shutdown_net (net);nfs4_state_shutdown_net (net); +nfsd_file_cache_shutdown_net (net);if (nn->lockd_up) {lockd_down (net); nn->lockd_up = false;
Signature · 1 line
2.38.1
Quoted 34 lines · Jeff Layton
Currently, we shut down the filecache before trying to clean up the stateids that depend on it. This leads to the kernel trying to free an
nfsd_filetwice, and a refcount overput on thenf_mark.Change the shutdown procedure to tear down all of the stateids prior to shutting down the filecache.
Reported-and-Tested-by Wang Yugui <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/nfsd/nfssvc.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/nfssvc.c +1
-1@@ -453,8 +453,8 @@ static void nfsd_shutdown_net(struct net *net) {struct nfsd_net *nn =net_generic (net, nfsd_net_id); -nfsd_file_cache_shutdown_net (net);nfs4_state_shutdown_net (net); +nfsd_file_cache_shutdown_net (net);if (nn->lockd_up) {lockd_down (net); nn->lockd_up = false;Signature · 1 line
2.38.1
Hi Jeff, seems sensible. May I add:
--
Chuck Lever
Jeff Layton
maintainerQuoted 36 lines · Chuck Lever III
Quoted 33 lines · Jeff Layton
Currently, we shut down the filecache before trying to clean up the stateids that depend on it. This leads to the kernel trying to free an
nfsd_filetwice, and a refcount overput on thenf_mark.Change the shutdown procedure to tear down all of the stateids prior to shutting down the filecache.
Reported-and-Tested-by Wang Yugui <[email protected]>Signed-off-by Jeff Layton <[email protected]>---
fs/nfsd/nfssvc.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/nfssvc.c +1
-1@@ -453,8 +453,8 @@ static void nfsd_shutdown_net(struct net *net) {struct nfsd_net *nn =net_generic (net, nfsd_net_id); -nfsd_file_cache_shutdown_net (net);nfs4_state_shutdown_net (net); +nfsd_file_cache_shutdown_net (net);if (nn->lockd_up) {lockd_down (net); nn->lockd_up = false;Signature · 1 line
2.38.1Hi Jeff, seems sensible. May I add:
Quoted 2 lines
Fixes 5e113224c17e ("nfsd: nfsd_file cache entries should be per net namespace")
Yes, thanks.
Signature · 1 line
Jeff Layton <[email protected]>