aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2014-07-30 19:08:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-07-30 20:16:13 -0400
commit52089b14c08f6ee9886c40b031712383fa24ddd9 (patch)
tree75dab80c770401054ef68a70461ca3e06e237c64 /mm
parent93a9eb39fad1b5fc9077776caa3af207883b254d (diff)
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 hwpoison_user_mappings(). 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: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Chen Yucong <slaoub@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory-failure.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 3db261fdee4c..a013bc94ebbe 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -911,8 +911,10 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
911 if (!page_mapped(hpage)) 911 if (!page_mapped(hpage))
912 return SWAP_SUCCESS; 912 return SWAP_SUCCESS;
913 913
914 if (PageKsm(p)) 914 if (PageKsm(p)) {
915 pr_err("MCE %#lx: can't handle KSM pages.\n", pfn);
915 return SWAP_FAIL; 916 return SWAP_FAIL;
917 }
916 918
917 if (PageSwapCache(p)) { 919 if (PageSwapCache(p)) {
918 printk(KERN_ERR 920 printk(KERN_ERR
@@ -1235,7 +1237,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1235 */ 1237 */
1236 if (hwpoison_user_mappings(p, pfn, trapno, flags, &hpage) 1238 if (hwpoison_user_mappings(p, pfn, trapno, flags, &hpage)
1237 != SWAP_SUCCESS) { 1239 != SWAP_SUCCESS) {
1238 printk(KERN_ERR "MCE %#lx: cannot unmap page, give up\n", pfn); 1240 action_result(pfn, "unmapping failed", IGNORED);
1239 res = -EBUSY; 1241 res = -EBUSY;
1240 goto out; 1242 goto out;
1241 } 1243 }