]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] taint on bad_page
authorNick Piggin <nickpiggin@yahoo.com.au>
Tue, 19 Oct 2004 01:15:02 +0000 (18:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 19 Oct 2004 01:15:02 +0000 (18:15 -0700)
Hugh and I both thought this would be generally useful.

Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/kernel.h
kernel/panic.c
mm/page_alloc.c

index f60ba2c96469c92ee7f6cf80465430d3b81c6f0e..cf2f984e1b955e6360a28e99816cf853679964d7 100644 (file)
@@ -152,6 +152,7 @@ extern enum system_states {
 #define TAINT_UNSAFE_SMP               (1<<2)
 #define TAINT_FORCED_RMMOD             (1<<3)
 #define TAINT_MACHINE_CHECK            (1<<4)
+#define TAINT_BAD_PAGE                 (1<<5)
 
 extern void dump_stack(void);
 
index 6dddb56fbdad047ad6a2e110bed0cead21a13ead..c7ab9981c7aa762c3ff5703b142b71466f123b7b 100644 (file)
@@ -112,6 +112,7 @@ EXPORT_SYMBOL(panic);
  *  'S' - SMP with CPUs not designed for SMP.
  *  'R' - User forced a module unload.
  *  'M' - Machine had a machine check experience.
+ *  'B' - System has hit bad_page.
  *
  *     The string is overwritten by the next call to print_taint().
  */
@@ -120,12 +121,13 @@ const char *print_tainted(void)
 {
        static char buf[20];
        if (tainted) {
-               snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c",
+               snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c",
                        tainted & TAINT_PROPRIETARY_MODULE ? 'P' : 'G',
                        tainted & TAINT_FORCED_MODULE ? 'F' : ' ',
                        tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
                        tainted & TAINT_FORCED_RMMOD ? 'R' : ' ',
-                       tainted & TAINT_MACHINE_CHECK ? 'M' : ' ');
+                       tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
+                       tainted & TAINT_BAD_PAGE ? 'B' : ' ');
        }
        else
                snprintf(buf, sizeof(buf), "Not tainted");
index bd4e102ee22e3018570cb9bc64efe1c9f1280d63..274a7af40a89ec269138d678dd1d0dec1f8bf2ed 100644 (file)
@@ -94,6 +94,7 @@ static void bad_page(const char *function, struct page *page)
        set_page_count(page, 0);
        reset_page_mapcount(page);
        page->mapping = NULL;
+       tainted |= TAINT_BAD_PAGE;
 }
 
 #ifndef CONFIG_HUGETLB_PAGE