Skip to content

Commit fd5e363

Browse files
JulianMarcusSchroeder1chucklever
authored andcommitted
nfsd: destroy percpu stats counters after reply cache shutdown
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: e567b98 (“nfsd: protect concurrent access to nfsd stats counters”) Signed-off-by: Julian Schroeder <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 6f6f84a commit fd5e363

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfscache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
206206
struct svc_cacherep *rp;
207207
unsigned int i;
208208

209-
nfsd_reply_cache_stats_destroy(nn);
210209
unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
211210

212211
for (i = 0; i < nn->drc_hashsize; i++) {
@@ -217,6 +216,7 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
217216
rp, nn);
218217
}
219218
}
219+
nfsd_reply_cache_stats_destroy(nn);
220220

221221
kvfree(nn->drc_hashtbl);
222222
nn->drc_hashtbl = NULL;

0 commit comments

Comments
 (0)