diff options
author | Trond Myklebust <trondmy@gmail.com> | 2020-01-06 19:18:05 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2020-01-22 22:25:40 +0100 |
commit | 9542e6a643fc69d528dfb3303f145719c61d3050 (patch) | |
tree | ac894c5a0dc0fa6c8ba0c37bbb1e70df7cba755e /fs/nfsd/nfssvc.c | |
parent | nfsd: cleanup nfsd_file_lru_dispose() (diff) | |
download | linux-9542e6a643fc69d528dfb3303f145719c61d3050.tar.xz linux-9542e6a643fc69d528dfb3303f145719c61d3050.zip |
nfsd: Containerise filecache laundrette
Ensure that if the filecache laundrette gets stuck, it only affects
the knfsd instances of one container.
The notifier callbacks can be called from various contexts so avoid
using synchonous filesystem operations that might deadlock.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r-- | fs/nfsd/nfssvc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 7900f3494ecb..3b77b904212d 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -400,13 +400,18 @@ static int nfsd_startup_net(int nrservs, struct net *net, const struct cred *cre nn->lockd_up = true; } - ret = nfs4_state_start_net(net); + ret = nfsd_file_cache_start_net(net); if (ret) goto out_lockd; + ret = nfs4_state_start_net(net); + if (ret) + goto out_filecache; nn->nfsd_net_up = true; return 0; +out_filecache: + nfsd_file_cache_shutdown_net(net); out_lockd: if (nn->lockd_up) { lockd_down(net); @@ -421,7 +426,7 @@ static void nfsd_shutdown_net(struct net *net) { struct nfsd_net *nn = net_generic(net, nfsd_net_id); - nfsd_file_cache_purge(net); + nfsd_file_cache_shutdown_net(net); nfs4_state_shutdown_net(net); if (nn->lockd_up) { lockd_down(net); |