From: Christoph Lameter Date: Wed, 23 May 2007 20:57:31 +0000 (-0700) Subject: SLUB Debug: Fix object size calculation X-Git-Tag: v2.6.22-rc3~77 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c12b3c62513ecf95c979d5c1785f99562b9dd10d;p=linux-2.6 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 Acked-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slub.c b/mm/slub.c index 98801d404d..0b0c2a3e76 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1917,7 +1917,6 @@ static int calculate_sizes(struct kmem_cache *s) */ s->inuse = size; -#ifdef CONFIG_SLUB_DEBUG if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) || s->ctor)) { /* @@ -1932,6 +1931,7 @@ static int calculate_sizes(struct kmem_cache *s) size += sizeof(void *); } +#ifdef CONFIG_SLUB_DEBUG if (flags & SLAB_STORE_USER) /* * Need to store information about allocs and frees after