Skip to content

Commit 70438af

Browse files
J. Bruce Fieldsamschuma-ntap
authored andcommitted
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: Kris Karas <bugs-a17@moonlit-rail.com> Tested-By: Kris Karas <bugs-a17@moonlit-rail.com> Fixes: 95ad37f "NFSv4.2: add client side xattr caching." Signed-off-by: J. Bruce Fields <bfields@redhat.com> CC: stable@vger.kernel.org Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 3fc2bfa commit 70438af

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/nfs/nfs42xattr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,10 @@ int __init nfs4_xattr_cache_init(void)
10471047

10481048
void nfs4_xattr_cache_exit(void)
10491049
{
1050+
unregister_shrinker(&nfs4_xattr_large_entry_shrinker);
10501051
unregister_shrinker(&nfs4_xattr_entry_shrinker);
10511052
unregister_shrinker(&nfs4_xattr_cache_shrinker);
1053+
list_lru_destroy(&nfs4_xattr_large_entry_lru);
10521054
list_lru_destroy(&nfs4_xattr_entry_lru);
10531055
list_lru_destroy(&nfs4_xattr_cache_lru);
10541056
kmem_cache_destroy(nfs4_xattr_cache_cachep);

0 commit comments

Comments
 (0)