diff options
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r-- | mm/memory-failure.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index db08af92c6fc..fabe55046c1d 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -938,6 +938,16 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, | |||
938 | BUG_ON(!PageHWPoison(p)); | 938 | BUG_ON(!PageHWPoison(p)); |
939 | return SWAP_FAIL; | 939 | return SWAP_FAIL; |
940 | } | 940 | } |
941 | /* | ||
942 | * We pinned the head page for hwpoison handling, | ||
943 | * now we split the thp and we are interested in | ||
944 | * the hwpoisoned raw page, so move the refcount | ||
945 | * to it. | ||
946 | */ | ||
947 | if (hpage != p) { | ||
948 | put_page(hpage); | ||
949 | get_page(p); | ||
950 | } | ||
941 | /* THP is split, so ppage should be the real poisoned page. */ | 951 | /* THP is split, so ppage should be the real poisoned page. */ |
942 | ppage = p; | 952 | ppage = p; |
943 | } | 953 | } |