]> www.infradead.org Git - users/dwmw2/linux.git/commit
nfsd: don't free files unconditionally in __nfsd_file_cache_purge
authorJeff Layton <jlayton@kernel.org>
Fri, 20 Jan 2023 19:52:14 +0000 (14:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:25 +0000 (16:19 +0200)
commit0bc6d703109ef7441d27c8cd44d60d5926e13c20
tree8f7835712096e50ab4169e396348167d061bea26
parent958294a3eb82026fcfff20b0287a90e9c854785e
nfsd: don't free files unconditionally in __nfsd_file_cache_purge

[ Upstream commit 4bdbba54e9b1c769da8ded9abd209d765715e1d6 ]

nfsd_file_cache_purge is called when the server is shutting down, in
which case, tearing things down is generally fine, but it also gets
called when the exports cache is flushed.

Instead of walking the cache and freeing everything unconditionally,
handle it the same as when we have a notification of conflicting access.

Fixes: ac3a2585f018 ("nfsd: rework refcounting in filecache")
Reported-by: Ruben Vestergaard <rubenv@drcmr.dk>
Reported-by: Torkil Svensgaard <torkil@drcmr.dk>
Reported-by: Shachar Kagan <skagan@nvidia.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Shachar Kagan <skagan@nvidia.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/filecache.c