Re: [hugepage] Fix unmap_and_free_vma backout path

Bill Irwin
2006-11-14T23:48:13Z

On Mon, Nov 13, 2006 at 08:41:49PM +0000, Hugh Dickins wrote:
> [PATCH] hugetlb: prepare_hugepage_range check offset too
> prepare_hugepage_range should check file offset alignment when it checks
> virtual address and length, to stop MAP_FIXED with a bad huge offset from
> unmapping before it fails further down. PowerPC should apply the same
> prepare_hugepage_range alignment checks as ia64 and all the others do.
> Then none of the alignment checks in hugetlbfs_file_mmap are required
> (nor is the check for too small a mapping); but even so, move up setting
> of VM_HUGETLB and add a comment to warn of what David Gibson discovered -
> if hugetlbfs_file_mmap fails before setting it, do_mmap_pgoff's unmap_region
> when unwinding from error will go the non-huge way, which may cause bad
> behaviour on architectures (powerpc and ia64) which segregate their huge
> mappings into a separate region of the address space.
> Signed-off-by: Hugh Dickins <hugh@veritas.com>

Acked-by: William Irwin <wli@holomorphy.com>

-- wli