Right. The #ifdef CONFIG_SLUB_DEBUG is at the wrong location. The best fix
is to moving the #ifdef otherwise the size is still wrong for the
ctor case.
SLUB Debug: Fix object size calculation
The object size calculation is wrong if !CONFIG_SLUB_DEBUG because
the #ifdef CONFIG_SLUB_DEBUG is now switching off the size adjustments
for DESTROY_BY_RCU and ctor.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: slub/mm/slub.c
===================================================================
--- slub.orig/mm/slub.c 2007-05-21 11:21:36.000000000 -0700
+++ slub/mm/slub.c 2007-05-21 11:21:49.000000000 -0700
@@ -1943,7 +1943,6 @@ static int calculate_sizes(struct kmem_c
*/
s->inuse = size;
-#ifdef CONFIG_SLUB_DEBUG
if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) ||
s->ctor)) {
/*
@@ -1958,6 +1957,7 @@ static int calculate_sizes(struct kmem_c
size += sizeof(void *);
}
+#ifdef CONFIG_SLUB_DEBUG
if (flags & SLAB_STORE_USER)
/*
* Need to store information about allocs and frees after
-