Jesse Keating 2f82dd
From b04c57d9dc889462951312be2ac81ff6c702e954 Mon Sep 17 00:00:00 2001
Jesse Keating 2f82dd
From: Kyle McMartin <kyle@phobos.i.jkkm.org>
Jesse Keating 2f82dd
Date: Wed, 8 Jul 2009 13:05:09 -0400
Jesse Keating 2f82dd
Subject: [PATCH 3/6] fedora: linux-2.6-debug-taint-vm.patch
Jesse Keating 2f82dd
Jesse Keating 2f82dd
---
Jesse Keating 2f82dd
 kernel/panic.c  |    4 +++-
Jesse Keating 2f82dd
 mm/slab.c       |    8 ++++----
Jesse Keating 2f82dd
 mm/slub.c       |    2 +-
Jesse Keating 2f82dd
 4 files changed, 11 insertions(+), 8 deletions(-)
Jesse Keating 2f82dd
Jesse Keating 2f82dd
diff --git a/kernel/panic.c b/kernel/panic.c
Jesse Keating 2f82dd
index 984b3ec..6d1c3be 100644
Jesse Keating 2f82dd
--- a/kernel/panic.c
Jesse Keating 2f82dd
+++ b/kernel/panic.c
Jesse Keating 2f82dd
@@ -199,6 +199,7 @@ const char *print_tainted(void)
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
 	return buf;
Jesse Keating 2f82dd
 }
Jesse Keating 2f82dd
+EXPORT_SYMBOL(print_tainted);
Jesse Keating 2f82dd
 
Jesse Keating 2f82dd
 int test_taint(unsigned flag)
Jesse Keating 2f82dd
 {
Jesse Keating 2f82dd
diff --git a/mm/slab.c b/mm/slab.c
Jesse Keating 2f82dd
index e74a16e..7bc287e 100644
Jesse Keating 2f82dd
--- a/mm/slab.c
Jesse Keating 2f82dd
+++ b/mm/slab.c
Jesse Keating 2f82dd
@@ -1803,8 +1803,8 @@ static void check_poison_obj(struct kmem_cache *cachep, void *objp)
Jesse Keating 2f82dd
 			/* Print header */
Jesse Keating 2f82dd
 			if (lines == 0) {
Jesse Keating 2f82dd
 				printk(KERN_ERR
Jesse Keating 2f82dd
-					"Slab corruption: %s start=%p, len=%d\n",
Jesse Keating 2f82dd
-					cachep->name, realobj, size);
Jesse Keating 2f82dd
+					"Slab corruption (%s): %s start=%p, len=%d\n",
Jesse Keating 2f82dd
+					print_tainted(), cachep->name, realobj, size);
Jesse Keating 2f82dd
 				print_objinfo(cachep, objp, 0);
Jesse Keating 2f82dd
 			}
Jesse Keating 2f82dd
 			/* Hexdump the affected line */
Jesse Keating 2f82dd
@@ -2902,8 +2902,8 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp)
Jesse Keating 2f82dd
 	if (entries != cachep->num - slabp->inuse) {
Jesse Keating 2f82dd
 bad:
Jesse Keating 2f82dd
 		printk(KERN_ERR "slab: Internal list corruption detected in "
Jesse Keating 2f82dd
-				"cache '%s'(%d), slabp %p(%d). Hexdump:\n",
Jesse Keating 2f82dd
-			cachep->name, cachep->num, slabp, slabp->inuse);
Jesse Keating 2f82dd
+				"cache '%s'(%d), slabp %p(%d). Tainted(%s). Hexdump:\n",
Jesse Keating 2f82dd
+			cachep->name, cachep->num, slabp, slabp->inuse, print_tainted());
Jesse Keating 2f82dd
 		for (i = 0;
Jesse Keating 2f82dd
 		     i < sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t);
Jesse Keating 2f82dd
 		     i++) {
Jesse Keating 2f82dd
diff --git a/mm/slub.c b/mm/slub.c
Jesse Keating 2f82dd
index 819f056..8eff0f4 100644
Jesse Keating 2f82dd
--- a/mm/slub.c
Jesse Keating 2f82dd
+++ b/mm/slub.c
Jesse Keating 2f82dd
@@ -433,7 +433,7 @@ static void slab_bug(struct kmem_cache *s, char *fmt, ...)
Jesse Keating 2f82dd
 	va_end(args);
Jesse Keating 2f82dd
 	printk(KERN_ERR "========================================"
Jesse Keating 2f82dd
 			"=====================================\n");
Jesse Keating 2f82dd
-	printk(KERN_ERR "BUG %s: %s\n", s->name, buf);
Jesse Keating 2f82dd
+	printk(KERN_ERR "BUG %s (%s): %s\n", s->name, print_tainted(), buf);
Jesse Keating 2f82dd
 	printk(KERN_ERR "----------------------------------------"
Jesse Keating 2f82dd
 			"-------------------------------------\n\n");
Jesse Keating 2f82dd
 }
Jesse Keating 2f82dd
-- 
Jesse Keating 2f82dd
1.6.2.5
Jesse Keating 2f82dd