summaryrefslogtreecommitdiff
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorHillf Danton <dhillf@gmail.com>2011-11-01 04:09:38 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 04:30:50 +0400
commit0089e4853ae1ac161fae5137170971ccb6f4f152 (patch)
tree6e23993f320cd6b0d45a5fb4832188cd2092efe2 /mm/huge_memory.c
parentdf9d6985be2a7e7683c46e4c6ea608fc69f02b45 (diff)
downloadlinux-0089e4853ae1ac161fae5137170971ccb6f4f152.tar.xz
mm/huge_memory: fix copying user highpage
The THP copy-on-write handler falls back to regular-sized pages for a huge page replacement upon allocation failure or if THP has been individually disabled in the target VMA. The loop responsible for copying page-sized chunks accidentally uses multiples of PAGE_SHIFT instead of PAGE_SIZE as the virtual address arg for copy_user_highpage(). Signed-off-by: Hillf Danton <dhillf@gmail.com> Acked-by: Johannes Weiner <jweiner@redhat.com> Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 44f57631cd7c..ef954384f53a 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -830,7 +830,7 @@ static int do_huge_pmd_wp_page_fallback(struct mm_struct *mm,
for (i = 0; i < HPAGE_PMD_NR; i++) {
copy_user_highpage(pages[i], page + i,
- haddr + PAGE_SHIFT*i, vma);
+ haddr + PAGE_SIZE * i, vma);
__SetPageUptodate(pages[i]);
cond_resched();
}