Skip to content

Commit

Permalink
Use kernel slab for vn_cache and vn_file_cache
Browse files Browse the repository at this point in the history
Resolve a false positive in the kmemleak checker by shifting to the
kernel slab.  It shows up because vn_file_cache is using KMC_KMEM
which is directly allocated using __get_free_pages, which is not
automatically tracked by kmemleak.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs#599
  • Loading branch information
tuxoko authored and behlendorf committed Feb 3, 2017
1 parent 53cd26e commit 5208d44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/spl/spl-vnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,13 +873,13 @@ spl_vn_init(void)
sizeof(struct vnode), 64,
vn_cache_constructor,
vn_cache_destructor,
NULL, NULL, NULL, KMC_KMEM);
NULL, NULL, NULL, 0);

vn_file_cache = kmem_cache_create("spl_vn_file_cache",
sizeof(file_t), 64,
vn_file_cache_constructor,
vn_file_cache_destructor,
NULL, NULL, NULL, KMC_KMEM);
NULL, NULL, NULL, 0);
return (0);
} /* vn_init() */

Expand Down

0 comments on commit 5208d44

Please sign in to comment.