Skip to content

Commit 4102db1

Browse files
jtlaytonchucklever
authored andcommitted
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. Fixes: d47b295 ("NFSD: Use rhashtable for managing nfs4_file objects") Link: https://bugzilla.redhat.com/show_bug.cgi?id=2169017 Reported-by: JianHong Yin <[email protected]> Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 4bdbba5 commit 4102db1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfs4state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8182,7 +8182,6 @@ nfs4_state_shutdown_net(struct net *net)
81828182

81838183
nfsd4_client_tracking_exit(net);
81848184
nfs4_state_destroy_net(net);
8185-
rhltable_destroy(&nfs4_file_rhltable);
81868185
#ifdef CONFIG_NFSD_V4_2_INTER_SSC
81878186
nfsd4_ssc_shutdown_umount(nn);
81888187
#endif
@@ -8192,6 +8191,7 @@ void
81928191
nfs4_state_shutdown(void)
81938192
{
81948193
nfsd4_destroy_callback_queue();
8194+
rhltable_destroy(&nfs4_file_rhltable);
81958195
}
81968196

81978197
static void

0 commit comments

Comments
 (0)