linux-stable/fs/nfsd
Jeff Layton c00c20e3e3 nfsd: don't free files unconditionally in __nfsd_file_cache_purge
[ Upstream commit 4bdbba54e9 ]

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: ac3a2585f0 ("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>
2023-02-01 08:34:36 +01:00
..
acl.h NFSD: add posix ACLs to struct nfsd_attrs 2022-08-04 10:28:03 -04:00
auth.c
auth.h
blocklayout.c block: remove genhd.h 2022-02-02 07:49:59 -07:00
blocklayoutxdr.c
blocklayoutxdr.h
cache.h nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_reply_cache_stats_fops 2022-09-26 14:02:50 -04:00
current_stateid.h
export.c fs: add is_idmapped_mnt() helper 2021-12-03 18:44:06 +01:00
export.h nfsd: report per-export stats 2021-01-25 09:36:28 -05:00
fault_inject.c
filecache.c nfsd: don't free files unconditionally in __nfsd_file_cache_purge 2023-02-01 08:34:36 +01:00
filecache.h nfsd: fix handling of cached open files in nfsd4_open codepath 2023-01-18 11:58:26 +01:00
flexfilelayout.c nfsd: use correct format characters 2022-03-17 19:47:38 -04:00
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig NFSD: Remove CONFIG_NFSD_V3 2022-03-11 10:25:14 -05:00
lockd.c NFSD: simplify struct nfsfh 2021-10-02 15:51:10 -04:00
Makefile NFSD: Remove CONFIG_NFSD_V3 2022-03-11 10:25:14 -05:00
netns.h NFSD: add shrinker to reap courtesy clients on low memory condition 2022-09-26 14:02:41 -04:00
nfs2acl.c NFSD: Finish converting the NFSv2 GETACL result encoder 2022-12-31 13:31:58 +01:00
nfs3acl.c NFSD: Finish converting the NFSv3 GETACL result encoder 2022-12-31 13:31:58 +01:00
nfs3proc.c NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection 2023-01-18 11:58:25 +01:00
nfs3xdr.c NFSD: Clean up WRITE arg decoders 2022-09-26 14:02:47 -04:00
nfs4acl.c NFSD: add posix ACLs to struct nfsd_attrs 2022-08-04 10:28:03 -04:00
nfs4callback.c nfsd: under NFSv4.1, fix double svc_xprt_put on rpc_create failure 2022-12-31 13:32:53 +01:00
nfs4idmap.c NFSD: move from strlcpy with unused retval to strscpy 2022-09-26 14:02:20 -04:00
nfs4layouts.c NFSD: Add tracepoints to report NFSv4 callback completions 2022-09-26 14:02:32 -04:00
nfs4proc.c NFSD: fix use-after-free in nfsd4_ssc_setup_dul() 2023-02-01 08:34:09 +01:00
nfs4recover.c struct file-related stuff 2022-10-06 17:13:18 -07:00
nfs4state.c nfsd: fix handling of cached open files in nfsd4_open codepath 2023-01-18 11:58:26 +01:00
nfs4xdr.c Revert "SUNRPC: Use RMW bitops in single-threaded hot paths" 2023-01-14 10:33:42 +01:00
nfscache.c nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_reply_cache_stats_fops 2022-09-26 14:02:50 -04:00
nfsctl.c NFSD: unregister shrinker when nfsd_init_net() fails 2022-10-11 10:08:26 -04:00
nfsd.h NFSD: add shrinker to reap courtesy clients on low memory condition 2022-09-26 14:02:41 -04:00
nfsfh.c nfsd: ensure we always call fh_verify_error tracepoint 2022-10-13 12:12:37 -04:00
nfsfh.h NFSD: discard fh_locked flag and fh_lock/fh_unlock 2022-08-04 10:28:48 -04:00
nfsproc.c NFSD: Refactor common code out of dirlist helpers 2022-09-26 14:02:47 -04:00
nfssvc.c nfsd: shut down the NFSv4 state objects before the filecache 2023-01-12 12:02:00 +01:00
nfsxdr.c NFSD: Clean up WRITE arg decoders 2022-09-26 14:02:47 -04:00
pnfs.h
state.h nfsd: make nfsd4_run_cb a bool return function 2022-09-26 14:50:57 -04:00
stats.c nfsd: use DEFINE_PROC_SHOW_ATTRIBUTE to define nfsd_proc_ops 2022-09-26 14:02:49 -04:00
stats.h nfsd: make nfsd_stats.th_cnt atomic_t 2021-12-13 13:42:51 -05:00
trace.c NFSD: Add SPDX header for fs/nfsd/trace.c 2020-11-30 13:00:24 -05:00
trace.h nfsd: fix handling of cached open files in nfsd4_open codepath 2023-01-18 11:58:26 +01:00
vfs.c NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection 2023-01-18 11:58:25 +01:00
vfs.h NFSD: Pass the target nfsd_file to nfsd_commit() 2023-01-18 11:58:25 +01:00
xdr.h NFSD: prevent underflow in nfssvc_decode_writeargs() 2022-03-15 09:35:56 -04:00
xdr3.h SUNRPC: Change return value type of .pc_encode 2021-10-13 11:34:49 -04:00
xdr4.h NFSD: Pack struct nfsd4_compoundres 2022-09-26 14:02:49 -04:00
xdr4cb.h