diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-04-23 15:31:08 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-04-27 11:26:06 -0400 |
commit | d629d819579327267884a12de21ef6d4b539db88 (patch) | |
tree | a3f7c40fbcaef54b0dce0affc8cadf101ace046d /mm | |
parent | 0701a9e649bf0ffdac0a761d3c3d1041f5375d90 (diff) |
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 <mingo@elte.hu>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2426,8 +2426,11 @@ void kmem_cache_destroy(struct kmem_cache *s) | |||
2426 | if (!s->refcount) { | 2426 | if (!s->refcount) { |
2427 | list_del(&s->list); | 2427 | list_del(&s->list); |
2428 | up_write(&slub_lock); | 2428 | up_write(&slub_lock); |
2429 | if (kmem_cache_close(s)) | 2429 | if (kmem_cache_close(s)) { |
2430 | WARN_ON(1); | 2430 | printk(KERN_ERR "SLUB %s: %s called for cache that " |
2431 | "still has objects.\n", s->name, __func__); | ||
2432 | dump_stack(); | ||
2433 | } | ||
2431 | sysfs_slab_remove(s); | 2434 | sysfs_slab_remove(s); |
2432 | } else | 2435 | } else |
2433 | up_write(&slub_lock); | 2436 | up_write(&slub_lock); |