aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-10-19 02:15:01 -0400
committerAndi Kleen <ak@linux.intel.com>2009-10-19 02:15:01 -0400
commit7456b0405d8fc063c49628f969cdb23be060fc80 (patch)
treeb1216354d6940b800128b224e2d801ed9232fa02 /mm
parent65a64464349883891e21e74af16c05d6e1eeb4e9 (diff)
HWPOISON: fix invalid page count in printk output
The madvise injector already holds a reference when passing in a page to the memory-failure code. The code corrects for this additional reference for its checks, but the final printk output didn't. Fix that. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory-failure.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index e354b9f2f389..dacc64183874 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -613,13 +613,16 @@ static int page_action(struct page_state *ps, struct page *p,
613 unsigned long pfn, int ref) 613 unsigned long pfn, int ref)
614{ 614{
615 int result; 615 int result;
616 int count;
616 617
617 result = ps->action(p, pfn); 618 result = ps->action(p, pfn);
618 action_result(pfn, ps->msg, result); 619 action_result(pfn, ps->msg, result);
619 if (page_count(p) != 1 + ref) 620
621 count = page_count(p) - 1 - ref;
622 if (count != 0)
620 printk(KERN_ERR 623 printk(KERN_ERR
621 "MCE %#lx: %s page still referenced by %d users\n", 624 "MCE %#lx: %s page still referenced by %d users\n",
622 pfn, ps->msg, page_count(p) - 1); 625 pfn, ps->msg, count);
623 626
624 /* Could do more checks here if page looks ok */ 627 /* Could do more checks here if page looks ok */
625 /* 628 /*