Skip to content

Commit 73674ab

Browse files
author
Herton R. Krzesinski
committed
Merge: nfsd: don't destroy global nfs4_file table in per-net shutdown
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2058 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2169017 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 <jiyin@redhat.com> Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeffrey Layton <jlayton@redhat.com> Approved-by: Scott Mayhew <smayhew@redhat.com> Approved-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents ad2d31c + 23bd196 commit 73674ab

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
@@ -7760,7 +7760,6 @@ nfs4_state_shutdown_net(struct net *net)
77607760

77617761
nfsd4_client_tracking_exit(net);
77627762
nfs4_state_destroy_net(net);
7763-
rhltable_destroy(&nfs4_file_rhltable);
77647763
#ifdef CONFIG_NFSD_V4_2_INTER_SSC
77657764
nfsd4_ssc_shutdown_umount(nn);
77667765
#endif
@@ -7770,6 +7769,7 @@ void
77707769
nfs4_state_shutdown(void)
77717770
{
77727771
nfsd4_destroy_callback_queue();
7772+
rhltable_destroy(&nfs4_file_rhltable);
77737773
}
77747774

77757775
static void

0 commit comments

Comments
 (0)