From: Linus Torvalds Date: Mon, 6 Mar 2006 20:10:07 +0000 (-0800) Subject: Fix "check_slabp" printout size calculation X-Git-Tag: v2.6.16-rc6~112 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=264132bc62fe071d0ff378c1103bae9d33212f10;p=linux-2.6 Fix "check_slabp" printout size calculation We want to use the "struct slab" size, not the size of the pointer to same. As it is, we'd not print out the last entry pointers in the slab (where is ~10, depending on whether it's a 32-bit or 64-bit kernel). Gaah, that slab code was written by somebody who likes unreadable crud. Signed-off-by: Linus Torvalds --- diff --git a/mm/slab.c b/mm/slab.c index add05d808a..2b0b1519bb 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2554,7 +2554,7 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp) "slab: Internal list corruption detected in cache '%s'(%d), slabp %p(%d). Hexdump:\n", cachep->name, cachep->num, slabp, slabp->inuse); for (i = 0; - i < sizeof(slabp) + cachep->num * sizeof(kmem_bufctl_t); + i < sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t); i++) { if ((i % 16) == 0) printk("\n%03x:", i);