diff mbox series

mm: slub: Print the broken data before restoring slub.

Message ID 20250120083023.4162932-1-hyesoo.yu@samsung.com (mailing list archive)
State New
Headers show
Series mm: slub: Print the broken data before restoring slub. | expand

Commit Message

Hyesoo Yu Jan. 20, 2025, 8:30 a.m. UTC
Previously, the restore occured after printing the object in slub.
After commit 47d911b ("slab: make check_object() more consistent"),
the bytes are printed after the restore. This information about the bytes
before the restore is highly valuable for debugging purpose.
For instance, in a event of cache issue, it displays byte patterns
by breaking them down into 64-bytes units. Without this information,
we can only speculate on how it was broken. Hence the corrupted regions
are printed prior to the restoration process.

Signed-off-by: Hyesoo Yu <hyesoo.yu@samsung.com>
Change-Id: Iac1df0526808edc2318f9988c757cdc3e40ae4b2
---
 mm/slub.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/mm/slub.c b/mm/slub.c
index c2151c9fee22..48cefc969480 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1207,6 +1207,7 @@  check_bytes_and_report(struct kmem_cache *s, struct slab *slab,
 					fault[0], value);
 
 skip_bug_print:
+	print_section(KERN_ERR, "Corrupt  ", fault, end - fault);
 	restore_bytes(s, what, value, fault, end);
 	return 0;
 }