summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-12-16 12:19:57 +0100
committerAndi Kleen <ak@linux.intel.com>2009-12-16 12:19:57 +0100
commita7560fc80f33cab33176ee78f146df22b28e3338 (patch)
tree1301b08559615aa5e7db0b11f03c98f3848c8142 /mm
parent9b9a29ecd75e310f75a9243e1c3538ad34598fcb (diff)
downloadlinux-a7560fc80f33cab33176ee78f146df22b28e3338.tar.gz
linux-a7560fc80f33cab33176ee78f146df22b28e3338.tar.bz2
linux-a7560fc80f33cab33176ee78f146df22b28e3338.zip
HWPOISON: return ENXIO on invalid page number
Use a different errno than the usual EIO for invalid page numbers. This is mainly for better reporting for the injector. This also avoids calling action_result() with invalid pfn. 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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 745f61082ce5..275f4e2df8ac 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -618,13 +618,11 @@ static struct page_state {
static void action_result(unsigned long pfn, char *msg, int result)
{
- struct page *page = NULL;
- if (pfn_valid(pfn))
- page = pfn_to_page(pfn);
+ struct page *page = pfn_to_page(pfn);
printk(KERN_ERR "MCE %#lx: %s%s page recovery: %s\n",
pfn,
- page && PageDirty(page) ? "dirty " : "",
+ PageDirty(page) ? "dirty " : "",
msg, action_name[result]);
}
@@ -750,8 +748,10 @@ int __memory_failure(unsigned long pfn, int trapno, int ref)
panic("Memory failure from trap %d on page %lx", trapno, pfn);
if (!pfn_valid(pfn)) {
- action_result(pfn, "memory outside kernel control", IGNORED);
- return -EIO;
+ printk(KERN_ERR
+ "MCE %#lx: memory outside kernel control\n",
+ pfn);
+ return -ENXIO;
}
p = pfn_to_page(pfn);