Commit 01a36916 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds
Browse files

mm: switch gup_hugepte to use try_get_compound_head

This applies the overflow fixes from 8fde12ca ("mm: prevent
get_user_pages() from overflowing page refcount") to the powerpc hugepd
code and brings it back in sync with the other GUP cases.


Signed-off-by: default avatarChristoph Hellwig <>
Cc: Andrey Konovalov <>
Cc: Benjamin Herrenschmidt <>
Cc: David Miller <>
Cc: James Hogan <>
Cc: Jason Gunthorpe <>
Cc: Khalid Aziz <>
Cc: Michael Ellerman <>
Cc: Nicholas Piggin <>
Cc: Paul Burton <>
Cc: Paul Mackerras <>
Cc: Ralf Baechle <>
Cc: Rich Felker <>
Cc: Yoshinori Sato <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent cbd34da7
......@@ -2006,7 +2006,8 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
} while (addr += PAGE_SIZE, addr != end);
if (!page_cache_add_speculative(head, refs)) {
head = try_get_compound_head(head, refs);
if (!head) {
*nr -= refs;
return 0;
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