nfsd: don't destroy global nfs4_file table in per-net shutdown
authorJeff Layton <jlayton@kernel.org>
Sat, 11 Feb 2023 12:50:08 +0000 (07:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:25 +0000 (16:19 +0200)
commit005ef7285fb98a29afb9703adcf66d05e0953684
tree6d16b046a7dd864fdd46c877187320427645d52f
parent0bc6d703109ef7441d27c8cd44d60d5926e13c20
nfsd: don't destroy global nfs4_file table in per-net shutdown

[ Upstream commit 4102db175b5d884d133270fdbd0e59111ce688fc ]

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: d47b295e8d76 ("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>
fs/nfsd/nfs4state.c