Skip to content

Commit

Permalink
slub: do not fail if we cannot register a slab with sysfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Aug 31, 2007
1 parent 4ccdb4c commit 5d540fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3813,15 +3813,19 @@ 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) {
struct saved_alias *al = alias_list;

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);
}

Expand Down

0 comments on commit 5d540fb

Please sign in to comment.