diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-05-23 16:57:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 23:14:13 -0400 |
commit | 33e9e24101abac2bf3535d0d013d6d27d19197cb (patch) | |
tree | 04d4e3952331b66fef36efa0dc0612cd4f6385c9 | |
parent | 418508c13222ddba475873ea95c8aeadd26104f2 (diff) |
SLUB Debug: fix check for super sized slabs (>512k 64bit, >256k 32bit)
The check for super sized slabs where we can no longer move the free
pointer behind the object for debugging purposes etc is accessing a
field that is not setup yet. We must use objsize here since the size of
the slab has not been determined yet.
The effect of this is that a global slab shrink via "slabinfo -s" will
show errors about offsets being wrong if booted with slub_debug.
Potentially there are other troubles with huge slabs under slub_debug
because the calculated free pointer offset is truncated.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/slub.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -939,7 +939,7 @@ static void kmem_cache_open_debug_check(struct kmem_cache *s) | |||
939 | * Debugging or ctor may create a need to move the free | 939 | * Debugging or ctor may create a need to move the free |
940 | * pointer. Fail if this happens. | 940 | * pointer. Fail if this happens. |
941 | */ | 941 | */ |
942 | if (s->size >= 65535 * sizeof(void *)) { | 942 | if (s->objsize >= 65535 * sizeof(void *)) { |
943 | BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON | | 943 | BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON | |
944 | SLAB_STORE_USER | SLAB_DESTROY_BY_RCU)); | 944 | SLAB_STORE_USER | SLAB_DESTROY_BY_RCU)); |
945 | BUG_ON(s->ctor); | 945 | BUG_ON(s->ctor); |