Commit 52089b14 authored by Naoya Horiguchi's avatar Naoya Horiguchi Committed by Linus Torvalds
Browse files

hwpoison: call action_result() in failure path of hwpoison_user_mappings()

hwpoison_user_mappings() could fail for various reasons, so printk()s to
print out the reasons should be done in each failure check inside

And currently we don't call action_result() when hwpoison_user_mappings()
fails, which is not consistent with other exit points of memory error
handler.  So this patch fixes these messaging problems.
Signed-off-by: default avatarNaoya Horiguchi <>
Cc: Andi Kleen <>
Cc: Chen Yucong <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 93a9eb39
......@@ -911,8 +911,10 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
if (!page_mapped(hpage))
if (PageKsm(p))
if (PageKsm(p)) {
pr_err("MCE %#lx: can't handle KSM pages.\n", pfn);
return SWAP_FAIL;
if (PageSwapCache(p)) {
......@@ -1235,7 +1237,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
if (hwpoison_user_mappings(p, pfn, trapno, flags, &hpage)
printk(KERN_ERR "MCE %#lx: cannot unmap page, give up\n", pfn);
action_result(pfn, "unmapping failed", IGNORED);
res = -EBUSY;
goto out;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment