From: Hugh Dickins He who lectures others about hugetlbfs truncation might discover that it's got screwed by his very own self. I replaced zap_hugepage_range by unmap_hugepage_range, overlooking that zap used "len" but unmap "end". Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Index: linux-2.6/fs/hugetlbfs/inode.c =================================================================== --- linux-2.6.orig/fs/hugetlbfs/inode.c +++ linux-2.6/fs/hugetlbfs/inode.c @@ -308,7 +308,6 @@ hugetlb_vmtruncate_list(struct prio_tree vma_prio_tree_foreach(vma, &iter, root, h_pgoff, ULONG_MAX) { unsigned long h_vm_pgoff; - unsigned long v_length; unsigned long v_offset; h_vm_pgoff = vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT); @@ -319,11 +318,8 @@ hugetlb_vmtruncate_list(struct prio_tree if (h_vm_pgoff >= h_pgoff) v_offset = 0; - v_length = vma->vm_end - vma->vm_start; - unmap_hugepage_range(vma, - vma->vm_start + v_offset, - v_length - v_offset); + vma->vm_start + v_offset, vma->vm_end); } }