slub: do not fail if we cannot register a slab with sysfs
authorChristoph Lameter <clameter@sgi.com>
Fri, 31 Aug 2007 06:56:26 +0000 (23:56 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 31 Aug 2007 08:42:22 +0000 (01:42 -0700)
Do not BUG() if we cannot register a slab with sysfs.  Just print an error.
 The only consequence of not registering is that the slab cache is not
visible via /sys/slab.  A BUG() may not be visible that early during boot
and we have had multiple issues here already.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slub.c

index 04151da399c6ce8c344409c2ce7fbf289ac645e5..7defe84e6bd0bfec5e8c8f6b7833f2f2c0ea53ea 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3813,7 +3813,9 @@ static int __init slab_sysfs_init(void)
 
        list_for_each_entry(s, &slab_caches, list) {
                err = sysfs_slab_add(s);
-               BUG_ON(err);
+               if (err)
+                       printk(KERN_ERR "SLUB: Unable to add boot slab %s"
+                                               " to sysfs\n", s->name);
        }
 
        while (alias_list) {
@@ -3821,7 +3823,9 @@ static int __init slab_sysfs_init(void)
 
                alias_list = alias_list->next;
                err = sysfs_slab_alias(al->s, al->name);
-               BUG_ON(err);
+               if (err)
+                       printk(KERN_ERR "SLUB: Unable to add boot slab alias"
+                                       " %s to sysfs\n", s->name);
                kfree(al);
        }