]> git.baikalelectronics.ru Git - kernel.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, 1 Feb 2023 07:34:36 +0000 (08:34 +0100)
commit70dd0b665a6e5b04e0b05aa7b44ee8673510b9a6
tree240ab9ebfb612d3b8537f8c3a6e06c3f7d718fae
parentb8141fb7a2ad9a1a17c741a6bc4afb553f220813
nfsd: don't free files unconditionally in __nfsd_file_cache_purge

[ Upstream commit 41c43bade5acdacecb2d8aa9fa58ed6b3f975e26 ]

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: d909bd75e7ca ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/filecache.c