Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / lib / bug.c
index 1e094408c893db33f42542960406e93eb19a1d87..c1b0fad31b109157427d1ec1e30e7e93e303465d 100644 (file)
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -186,7 +186,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
                return BUG_TRAP_TYPE_WARN;
        }
 
-       printk(KERN_DEFAULT "------------[ cut here ]------------\n");
+       printk(KERN_DEFAULT CUT_HERE);
 
        if (file)
                pr_crit("kernel BUG at %s:%u!\n", file, line);
@@ -196,3 +196,26 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
 
        return BUG_TRAP_TYPE_BUG;
 }
+
+static void clear_once_table(struct bug_entry *start, struct bug_entry *end)
+{
+       struct bug_entry *bug;
+
+       for (bug = start; bug < end; bug++)
+               bug->flags &= ~BUGFLAG_DONE;
+}
+
+void generic_bug_clear_once(void)
+{
+#ifdef CONFIG_MODULES
+       struct module *mod;
+
+       rcu_read_lock_sched();
+       list_for_each_entry_rcu(mod, &module_bug_list, bug_list)
+               clear_once_table(mod->bug_table,
+                                mod->bug_table + mod->num_bugs);
+       rcu_read_unlock_sched();
+#endif
+
+       clear_once_table(__start___bug_table, __stop___bug_table);
+}