summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-10-19 08:15:01 +0200
committerAndi Kleen <ak@linux.intel.com>2009-10-19 08:15:01 +0200
commit7456b0405d8fc063c49628f969cdb23be060fc80 (patch)
treeb1216354d6940b800128b224e2d801ed9232fa02 /mm
parent65a64464349883891e21e74af16c05d6e1eeb4e9 (diff)
downloadop-kernel-dev-7456b0405d8fc063c49628f969cdb23be060fc80.zip
op-kernel-dev-7456b0405d8fc063c49628f969cdb23be060fc80.tar.gz
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 e354b9f..dacc641 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,
unsigned long pfn, int ref)
{
int result;
+ int count;
result = ps->action(p, pfn);
action_result(pfn, ps->msg, result);
- if (page_count(p) != 1 + ref)
+
+ count = page_count(p) - 1 - ref;
+ if (count != 0)
printk(KERN_ERR
"MCE %#lx: %s page still referenced by %d users\n",
- pfn, ps->msg, page_count(p) - 1);
+ pfn, ps->msg, count);
/* Could do more checks here if page looks ok */
/*
OpenPOWER on IntegriCloud