aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-05-23 12:38:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-05-23 12:38:07 -0400
commitfc3ac5c75bae55ca6a070eb72038a94d4f130d8d (patch)
tree9ff7417bda4655bafa961bebf600ea6fd0cab8a4 /mm/memory-failure.c
parent9abd09acd664c68f06242da191209d9c70df6953 (diff)
parent0d9327ab70038ac8c7af6e20456578ab80158f2d (diff)
Merge branch 'akpm' (incoming from Andrew)
Merge misc fixes from Andrew Morton: "9 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: MAINTAINERS: add closing angle bracket to Vince Bridgers' email address Documentation: fix DOCBOOKS=... building ocfs2: fix double kmem_cache_destroy in dlm_init mm/memory-failure.c: fix memory leak by race between poison and unpoison wait: swap EXIT_ZOMBIE(Z) and EXIT_DEAD(X) chars in TASK_STATE_TO_CHAR_STR memcg: fix swapcache charge from kernel thread context mm: madvise: fix MADV_WILLNEED on shmem swapouts mm/filemap.c: avoid always dirtying mapping->flags on O_DIRECT hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 35ef28acf137..9ccef39a9de2 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1081,15 +1081,16 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1081 return 0; 1081 return 0;
1082 } else if (PageHuge(hpage)) { 1082 } else if (PageHuge(hpage)) {
1083 /* 1083 /*
1084 * Check "just unpoisoned", "filter hit", and 1084 * Check "filter hit" and "race with other subpage."
1085 * "race with other subpage."
1086 */ 1085 */
1087 lock_page(hpage); 1086 lock_page(hpage);
1088 if (!PageHWPoison(hpage) 1087 if (PageHWPoison(hpage)) {
1089 || (hwpoison_filter(p) && TestClearPageHWPoison(p)) 1088 if ((hwpoison_filter(p) && TestClearPageHWPoison(p))
1090 || (p != hpage && TestSetPageHWPoison(hpage))) { 1089 || (p != hpage && TestSetPageHWPoison(hpage))) {
1091 atomic_long_sub(nr_pages, &num_poisoned_pages); 1090 atomic_long_sub(nr_pages, &num_poisoned_pages);
1092 return 0; 1091 unlock_page(hpage);
1092 return 0;
1093 }
1093 } 1094 }
1094 set_page_hwpoison_huge_page(hpage); 1095 set_page_hwpoison_huge_page(hpage);
1095 res = dequeue_hwpoisoned_huge_page(hpage); 1096 res = dequeue_hwpoisoned_huge_page(hpage);
@@ -1152,6 +1153,8 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
1152 */ 1153 */
1153 if (!PageHWPoison(p)) { 1154 if (!PageHWPoison(p)) {
1154 printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn); 1155 printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn);
1156 atomic_long_sub(nr_pages, &num_poisoned_pages);
1157 put_page(hpage);
1155 res = 0; 1158 res = 0;
1156 goto out; 1159 goto out;
1157 } 1160 }