aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGu Zheng <[email protected]>2014-08-06 16:04:51 -0700
committerLinus Torvalds <[email protected]>2014-08-06 18:01:15 -0700
commit4307c14f3c77bc0cb0facfc9c67c7872505aaedf (patch)
treef45db34edc9d30000590d05f530a7a5ea785ae84
parent0aa9a13d80bae1bb24956f6e3e2662b7242e0b41 (diff)
slab: fix the alias count (via sysfs) of slab cache
We mark some slab caches (e.g. kmem_cache_node) as unmergeable by setting refcount to -1, and their alias should be 0, not refcount-1, so correct it here. Signed-off-by: Gu Zheng <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/slub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index d9aadbfe7c29..9b861b90cde1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4466,7 +4466,7 @@ SLAB_ATTR_RO(ctor);
static ssize_t aliases_show(struct kmem_cache *s, char *buf)
{
- return sprintf(buf, "%d\n", s->refcount - 1);
+ return sprintf(buf, "%d\n", s->refcount < 0 ? 0 : s->refcount - 1);
}
SLAB_ATTR_RO(aliases);