提交 face37f5 编写于 作者: D Dave Jones 提交者: Pekka Enberg

slab: add taint flag outputting to debug paths.

When we get corruption reports, it's useful to see if the kernel was
tainted, to rule out problems we can't do anything about.
Signed-off-by: NDave Jones <davej@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NPekka Enberg <penberg@kernel.org>
上级 265d47e7
...@@ -1941,8 +1941,8 @@ static void check_poison_obj(struct kmem_cache *cachep, void *objp) ...@@ -1941,8 +1941,8 @@ static void check_poison_obj(struct kmem_cache *cachep, void *objp)
/* Print header */ /* Print header */
if (lines == 0) { if (lines == 0) {
printk(KERN_ERR printk(KERN_ERR
"Slab corruption: %s start=%p, len=%d\n", "Slab corruption (%s): %s start=%p, len=%d\n",
cachep->name, realobj, size); print_tainted(), cachep->name, realobj, size);
print_objinfo(cachep, objp, 0); print_objinfo(cachep, objp, 0);
} }
/* Hexdump the affected line */ /* Hexdump the affected line */
...@@ -3051,8 +3051,9 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp) ...@@ -3051,8 +3051,9 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp)
if (entries != cachep->num - slabp->inuse) { if (entries != cachep->num - slabp->inuse) {
bad: bad:
printk(KERN_ERR "slab: Internal list corruption detected in " printk(KERN_ERR "slab: Internal list corruption detected in "
"cache '%s'(%d), slabp %p(%d). Hexdump:\n", "cache '%s'(%d), slabp %p(%d). Tainted(%s). Hexdump:\n",
cachep->name, cachep->num, slabp, slabp->inuse); cachep->name, cachep->num, slabp, slabp->inuse,
print_tainted());
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, slabp, print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, slabp,
sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t), sizeof(*slabp) + cachep->num * sizeof(kmem_bufctl_t),
1); 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册