nfsd: don't destroy global nfs4_file table in per-net shutdown
Subsystems (2)
Jeff Layton
maintainerPATCH 1/1 nfsd: don't destroy global nfs4_file table in per-net shutdown
The nfs4_file table is global, so shutting it down when a containerized nfsd is shut down is wrong and can lead to double-frees. Tear down the nfs4_file_rhltable in nfs4_state_shutdown instead of nfs4_state_shutdown_net.
--- fs/nfsd/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4state.c +1 -1
@@ -8218,7 +8218,6 @@ nfs4_state_shutdown_net(struct net *net)nfsd4_client_tracking_exit (net);nfs4_state_destroy_net (net); -rhltable_destroy (&nfs4_file_rhltable);#ifdef CONFIG_NFSD_V4_2_INTER_SSC nfsd4_ssc_shutdown_umount (nn);#endif
@@ -8228,6 +8227,7 @@ voidnfs4_state_shutdown (void) {nfsd4_destroy_callback_queue (); +rhltable_destroy (&nfs4_file_rhltable); } static void
Signature · 1 line
2.39.1
Quoted 8 lines · Jeff Layton
The
nfs4_filetable is global, so shutting it down when a containerized nfsd is shut down is wrong and can lead to double-frees. Tear down thenfs4_file_rhltableinnfs4_state_shutdowninstead ofnfs4_state_shutdown_net.
D'oh!
Quoted 4 lines
Fixes d47b295e8d76 (NFSD: Use rhashtable for managing nfs4_file objects)Reported-by JianHong Yin <[email protected]>Signed-off-by Jeff Layton <[email protected]>
Thanks to you and JianHong. Applied to nfsd-fixes.
Quoted 23 lines
---
fs/nfsd/nfs4state.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/nfs4state.c +1
-1@@ -8218,7 +8218,6 @@ nfs4_state_shutdown_net(struct net *net)nfsd4_client_tracking_exit (net);nfs4_state_destroy_net (net); -rhltable_destroy (&nfs4_file_rhltable);#ifdef CONFIG_NFSD_V4_2_INTER_SSC nfsd4_ssc_shutdown_umount (nn);#endif @@ -8228,6 +8227,7 @@ voidnfs4_state_shutdown (void) {nfsd4_destroy_callback_queue (); +rhltable_destroy (&nfs4_file_rhltable); }
Quoted 4 lines
static void
Signature · 1 line
2.39.1
--
Chuck Lever
Jeff Layton
maintainerQuoted 11 lines · Chuck Lever III
Quoted 7 lines · Jeff Layton
The
nfs4_filetable is global, so shutting it down when a containerized nfsd is shut down is wrong and can lead to double-frees. Tear down thenfs4_file_rhltableinnfs4_state_shutdowninstead ofnfs4_state_shutdown_net.D'oh!
Quoted 7 lines
Quoted 4 lines
Fixes d47b295e8d76 (NFSD: Use rhashtable for managing nfs4_file objects)Reported-by JianHong Yin <[email protected]>Signed-off-by Jeff Layton <[email protected]>Thanks to you and JianHong. Applied to nfsd-fixes.
Thanks for grabbing it quickly. It'd be great to get this in before v6.2 ships...
Quoted 34 lines
Quoted 24 lines
---
fs/nfsd/nfs4state.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/nfs4state.c +1
-1@@ -8218,7 +8218,6 @@ nfs4_state_shutdown_net(struct net *net)nfsd4_client_tracking_exit (net);nfs4_state_destroy_net (net); -rhltable_destroy (&nfs4_file_rhltable);#ifdef CONFIG_NFSD_V4_2_INTER_SSC nfsd4_ssc_shutdown_umount (nn);#endif @@ -8228,6 +8227,7 @@ voidnfs4_state_shutdown (void) {nfsd4_destroy_callback_queue (); +rhltable_destroy (&nfs4_file_rhltable); }Quoted 4 lines
static void
Signature · 1 line
2.39.1--
Chuck Lever
Signature · 1 line
Jeff Layton <[email protected]>