]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: destroy percpu stats counters after reply cache shutdown
authorJulian Schroeder <jumaco@amazon.com>
Mon, 23 May 2022 18:52:26 +0000 (18:52 +0000)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 23 May 2022 19:22:17 +0000 (15:22 -0400)
commitc1bce405882ad92d5a22745c39bcf4957e7f9a90
treef1cf441a789754d474b448a7b8f0faf7d8b0838c
parentef853cb3567672726ea07a13a2066f31b119d423
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: a1be14f832011 (“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>
fs/nfsd/nfscache.c