mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
nfsd: destroy percpu stats counters after reply cache shutdown
[ Upstream commitfd5e363eac
] Upon nfsd shutdown any pending DRC cache is freed. DRC cache use is tracked via a percpu counter. In the current code the percpu counter is destroyed before. If any pending cache is still present, percpu_counter_add is called with a percpu counter==NULL. This causes a kernel crash. The solution is to destroy the percpu counter after the cache is freed. Fixes:e567b98ce9
(“nfsd: protect concurrent access to nfsd stats counters”) Signed-off-by: Julian Schroeder <jumaco@amazon.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
579944b9f3
commit
bc76727767
1 changed files with 1 additions and 1 deletions
|
@ -206,7 +206,6 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
|
||||||
struct svc_cacherep *rp;
|
struct svc_cacherep *rp;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
nfsd_reply_cache_stats_destroy(nn);
|
|
||||||
unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
|
unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
|
||||||
|
|
||||||
for (i = 0; i < nn->drc_hashsize; i++) {
|
for (i = 0; i < nn->drc_hashsize; i++) {
|
||||||
|
@ -217,6 +216,7 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
|
||||||
rp, nn);
|
rp, nn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
nfsd_reply_cache_stats_destroy(nn);
|
||||||
|
|
||||||
kvfree(nn->drc_hashtbl);
|
kvfree(nn->drc_hashtbl);
|
||||||
nn->drc_hashtbl = NULL;
|
nn->drc_hashtbl = NULL;
|
||||||
|
|
Loading…
Reference in a new issue