aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2012-01-10 18:07:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 19:30:42 -0500
commit1e16a539ac16e7b3a8c2cee188897d4bdb88e6e8 (patch)
tree12ee5589d6a04d54fc89c7970b6b8e5012d5e74f /mm
parentef009b25f4f8a77d2b32067d424d5ac757dcdc5b (diff)
mm/hugetlb.c: fix virtual address handling in hugetlb fault
handle_mm_fault() passes 'faulted' address to hugetlb_fault(). This address is not aligned to a hugepage boundary. Most of the functions for hugetlb pages are aware of that and calculate an alignment themselves. However some functions such as copy_user_huge_page() and clear_huge_page() don't handle alignment by themselves. This patch make hugeltb_fault() fix the alignment and pass an aligned addresss (to address of a faulted hugepage) to functions. [akpm@linux-foundation.org: use &=] Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.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/hugetlb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 49e693b7fd0c..ab89d6f382d1 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2640,6 +2640,8 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2640 static DEFINE_MUTEX(hugetlb_instantiation_mutex); 2640 static DEFINE_MUTEX(hugetlb_instantiation_mutex);
2641 struct hstate *h = hstate_vma(vma); 2641 struct hstate *h = hstate_vma(vma);
2642 2642
2643 address &= huge_page_mask(h);
2644
2643 ptep = huge_pte_offset(mm, address); 2645 ptep = huge_pte_offset(mm, address);
2644 if (ptep) { 2646 if (ptep) {
2645 entry = huge_ptep_get(ptep); 2647 entry = huge_ptep_get(ptep);