提交 7456b040 编写于 作者: W Wu Fengguang 提交者: Andi Kleen

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: NWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: NAndi Kleen <ak@linux.intel.com>
上级 65a64464
......@@ -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 */
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册