From: Pekka Enberg Date: Wed, 23 Apr 2008 19:31:08 +0000 (+0300) Subject: slub: improve kmem_cache_destroy() error message X-Git-Tag: v2.6.26-rc1~695^2~13 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d629d819579327267884a12de21ef6d4b539db88;p=linux-2.6 slub: improve kmem_cache_destroy() error message As pointed out by Ingo, the SLUB warning of calling kmem_cache_destroy() with cache that still has objects triggers in practice. So turn this WARN_ON() into a nice SLUB specific error message to avoid people confusing it to a SLUB bug. Cc: Ingo Molnar Acked-by: Christoph Lameter Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index 39592b5ce6..378d3f1b54 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2426,8 +2426,11 @@ void kmem_cache_destroy(struct kmem_cache *s) if (!s->refcount) { list_del(&s->list); up_write(&slub_lock); - if (kmem_cache_close(s)) - WARN_ON(1); + if (kmem_cache_close(s)) { + printk(KERN_ERR "SLUB %s: %s called for cache that " + "still has objects.\n", s->name, __func__); + dump_stack(); + } sysfs_slab_remove(s); } else up_write(&slub_lock);