Commit 70438afb authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Anna Schumaker

NFSv4.2: fix failure to unregister shrinker

We forgot to unregister the nfs4_xattr_large_entry_shrinker.

That leaves the global list of shrinkers corrupted after unload of the
nfs module, after which possibly unrelated code that calls
register_shrinker() or unregister_shrinker() gets a BUG() with
"supervisor write access in kernel mode".

And similarly for the nfs4_xattr_large_entry_lru.
Reported-by: default avatarKris Karas <bugs-a17@moonlit-rail.com>
Tested-By: default avatarKris Karas <bugs-a17@moonlit-rail.com>
Fixes: 95ad37f9 "NFSv4.2: add client side xattr caching."
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
CC: stable@vger.kernel.org
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 3fc2bfa3
......@@ -1047,8 +1047,10 @@ int __init nfs4_xattr_cache_init(void)
void nfs4_xattr_cache_exit(void)
{
unregister_shrinker(&nfs4_xattr_large_entry_shrinker);
unregister_shrinker(&nfs4_xattr_entry_shrinker);
unregister_shrinker(&nfs4_xattr_cache_shrinker);
list_lru_destroy(&nfs4_xattr_large_entry_lru);
list_lru_destroy(&nfs4_xattr_entry_lru);
list_lru_destroy(&nfs4_xattr_cache_lru);
kmem_cache_destroy(nfs4_xattr_cache_cachep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment