Skip to content

Commit dcc7977

Browse files
songmuchunTrond Myklebust
authored andcommitted
NFSv4.2: Fix missing removal of SLAB_ACCOUNT on kmem_cache allocation
The commit 5c60e89 ("NFSv4.2: Fix up an invalid combination of memory allocation flags") has stripped GFP_KERNEL_ACCOUNT down to GFP_KERNEL, however, it forgot to remove SLAB_ACCOUNT from kmem_cache allocation. It means that memory is still limited by kmemcg. This patch also fix a NULL pointer reference issue [1] reported by NeilBrown. Link: https://lore.kernel.org/all/164870069595.25542.17292003658915487357@noble.neil.brown.name/ [1] Fixes: 5c60e89 ("NFSv4.2: Fix up an invalid combination of memory allocation flags") Fixes: 5abc1e3 ("mm: list_lru: allocate list_lru_one only when needed") Reported-by: NeilBrown <neilb@suse.de> Signed-off-by: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent f004320 commit dcc7977

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfs/nfs42xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ int __init nfs4_xattr_cache_init(void)
997997

998998
nfs4_xattr_cache_cachep = kmem_cache_create("nfs4_xattr_cache_cache",
999999
sizeof(struct nfs4_xattr_cache), 0,
1000-
(SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|SLAB_ACCOUNT),
1000+
(SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD),
10011001
nfs4_xattr_cache_init_once);
10021002
if (nfs4_xattr_cache_cachep == NULL)
10031003
return -ENOMEM;

0 commit comments

Comments
 (0)