forked from Minki/linux
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> Acked-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
72fcde9662
commit
c12b3c6251
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user