SLUB: 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 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 shrinking will show errors about offsets being wrong. Potentially there are other troubles with huge slabs because the offset is wrong. The patch makes slub work right. It will switch off all debugging for super sized slabs. Signed-off-by: Christoph Lameter --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: slub/mm/slub.c =================================================================== --- slub.orig/mm/slub.c 2007-05-18 10:14:05.000000000 -0700 +++ slub/mm/slub.c 2007-05-18 10:14:13.000000000 -0700 @@ -946,7 +946,7 @@ static void kmem_cache_open_debug_check( * Debugging or ctor may create a need to move the free * pointer. Fail if this happens. */ - if (s->size >= 65535 * sizeof(void *)) { + if (s->objsize >= 65535 * sizeof(void *)) { BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | SLAB_DESTROY_BY_RCU)); BUG_ON(s->ctor);