aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@sw.ru>2007-05-08 03:28:47 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:08 -0400
commita5c43dae7ae38c2a6b3e9a819bcf45f010bf6a4a (patch)
treeb30da7a4541e803e35a6a74ad33e836442c3f6c8 /mm
parent9d65cb4a1718a072898c7a57a3bc61b2dc4bcd4d (diff)
Fix race between cat /proc/slab_allocators and rmmod
Same story as with cat /proc/*/wchan race vs rmmod race, only /proc/slab_allocators want more info than just symbol name. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 1115e2065bfc..acda7e2d66e4 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -4432,16 +4432,12 @@ static void handle_slab(unsigned long *n, struct kmem_cache *c, struct slab *s)
4432static void show_symbol(struct seq_file *m, unsigned long address) 4432static void show_symbol(struct seq_file *m, unsigned long address)
4433{ 4433{
4434#ifdef CONFIG_KALLSYMS 4434#ifdef CONFIG_KALLSYMS
4435 char *modname;
4436 const char *name;
4437 unsigned long offset, size; 4435 unsigned long offset, size;
4438 char namebuf[KSYM_NAME_LEN+1]; 4436 char modname[MODULE_NAME_LEN + 1], name[KSYM_NAME_LEN + 1];
4439
4440 name = kallsyms_lookup(address, &size, &offset, &modname, namebuf);
4441 4437
4442 if (name) { 4438 if (lookup_symbol_attrs(address, &size, &offset, modname, name) == 0) {
4443 seq_printf(m, "%s+%#lx/%#lx", name, offset, size); 4439 seq_printf(m, "%s+%#lx/%#lx", name, offset, size);
4444 if (modname) 4440 if (modname[0])
4445 seq_printf(m, " [%s]", modname); 4441 seq_printf(m, " [%s]", modname);
4446 return; 4442 return;
4447 } 4443 }