NFSv4.2: fix failure to unregister shrinker
Subsystems (2)
PATCH 1/1 NFSv4.2: fix failure to unregister shrinker
From: "J. Bruce Fields" <[email protected]>
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.
--- fs/nfs/nfs42xattr.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/nfs42xattr.c +2 -0
@@ -1048,8 +1048,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);
Signature · 1 line
2.26.2
Looks like this patch got lost, do you need me to resend?
I should also have added a stable cc and a
Fixes: 95ad37f90c33 "NFSv4.2: add client side xattr caching."
--b.
Quoted 36 lines · bfields
From: "J. Bruce Fields" <[email protected]>
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()orunregister_shrinker()gets aBUG()with "supervisor write access in kernel mode".And similarly for the
nfs4_xattr_large_entry_lru.Reported-by Kris Karas <[email protected]>Tested-by Kris Karas <[email protected]>Signed-off-by J. Bruce Fields <[email protected]>--- fs/nfs/nfs42xattr.c | 2 ++ 1 file changed, 2 insertions(+)fs/nfs/nfs42xattr.c +2
-0@@ -1048,8 +1048,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);Signature · 1 line
2.26.2
No need to resend! I'll make sure the fixes & cc line get added to the commit
Quoted 46 lines · J. Bruce Fields
Looks like this patch got lost, do you need me to resend?
I should also have added a stable cc and a
Fixes: 95ad37f90c33 "NFSv4.2: add client side xattr caching."--b.
Quoted 36 lines · bfields
From: "J. Bruce Fields" <[email protected]>
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()orunregister_shrinker()gets aBUG()with "supervisor write access in kernel mode".And similarly for the
nfs4_xattr_large_entry_lru.Reported-by Kris Karas <[email protected]>Tested-by Kris Karas <[email protected]>Signed-off-by J. Bruce Fields <[email protected]>--- fs/nfs/nfs42xattr.c | 2 ++ 1 file changed, 2 insertions(+)fs/nfs/nfs42xattr.c +2
-1@@ -1048,8 +1048,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); --2.26.2