slob: Fix early boot kernel crash
authorChristoph Lameter <cl@linux.com>
Tue, 10 Jul 2012 23:31:05 +0000 (18:31 -0500)
committerPekka Enberg <penberg@kernel.org>
Thu, 12 Jul 2012 07:13:22 +0000 (10:13 +0300)
Commit fd3142a59af2012a7c5dc72ec97a4935ff1c5fc6 broke
slob since a piece of a change for a later patch slipped into
it.

Fengguang Wu writes:

  The commit crashes the kernel w/o any dmesg output (the attached one is
  created by the script as a summary for that run). This is very
  reproducible in kvm for the attached config.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slob.c

index 0111e0dece9309e167bbea1918127c4ec155ae89..45d4ca79933a84eec7e9e824f5d3117f3dc4dc64 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -518,7 +518,7 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size,
 
        if (c) {
                c->name = name;
-               c->size = c->object_size;
+               c->size = size;
                if (flags & SLAB_DESTROY_BY_RCU) {
                        /* leave room for rcu footer at the end of object */
                        c->size += sizeof(struct slob_rcu);