]> git.hungrycats.org Git - linux/commitdiff
[PATCH] make bad_page() print all of page->flags
authorWilliam Lee Irwin III <wli@holomorphy.com>
Fri, 3 Sep 2004 03:29:04 +0000 (20:29 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 3 Sep 2004 03:29:04 +0000 (20:29 -0700)
bad_page() only prints out 8 hexadecimal digits of page->flags regardless
of sizeof(page_flags_t).  This leads to confusing and/or incomplete bug
reports.  The following patch uses a field width argument to replace the
hardcoded %08lx so that bad_page() may print the whole of page->flags.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/page_alloc.c

index 327f35787fe26d12497794cdf8dccb2eccb95bb1..f2b5f575a4105fe2867df45b4915a215d7b368e1 100644 (file)
@@ -76,9 +76,9 @@ static void bad_page(const char *function, struct page *page)
 {
        printk(KERN_EMERG "Bad page state at %s (in process '%s', page %p)\n",
                function, current->comm, page);
-       printk(KERN_EMERG "flags:0x%08lx mapping:%p mapcount:%d count:%d\n",
-               (unsigned long)page->flags, page->mapping,
-               page_mapcount(page), page_count(page));
+       printk(KERN_EMERG "flags:0x%0*lx mapping:%p mapcount:%d count:%d\n",
+               (int)(2*sizeof(page_flags_t)), (unsigned long)page->flags,
+               page->mapping, page_mapcount(page), page_count(page));
        printk(KERN_EMERG "Backtrace:\n");
        dump_stack();
        printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n");