Skip to content

Commit

Permalink
HWPOISON: fix invalid page count in printk output
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wu Fengguang authored and Andi Kleen committed Oct 19, 2009
1 parent 65a6446 commit 7456b04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/*
Expand Down

0 comments on commit 7456b04

Please sign in to comment.