[PATCH 22/21] mm: fix unmap_vmas with inner ptlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
---

 fs/hugetlbfs/inode.c |    6 +-----
 1 files changed, 1 insertion(+), 5 deletions(-)

--- mm21/fs/hugetlbfs/inode.c	2005-10-11 23:57:59.000000000 +0100
+++ mm22/fs/hugetlbfs/inode.c	2005-10-14 23:28:42.000000000 +0100
@@ -284,7 +284,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);
@@ -295,11 +294,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);
 	}
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux