linux/arch/i386/mm
David Gibson dec4ad86c2 hugepage: fix broken check for offset alignment in hugepage mappings
For hugepage mappings, the file offset, like the address and size, needs to
be aligned to the size of a hugepage.

In commit 68589bc353, the check for this was
moved into prepare_hugepage_range() along with the address and size checks.
 But since BenH's rework of the get_unmapped_area() paths leading up to
commit 4b1d89290b, prepare_hugepage_range()
is only called for MAP_FIXED mappings, not for other mappings.  This means
we're no longer ever checking for an aligned offset - I've confirmed that
mmap() will (apparently) succeed with a misaligned offset on both powerpc
and i386 at least.

This patch restores the check, removing it from prepare_hugepage_range()
and putting it back into hugetlbfs_file_mmap().  I'm putting it there,
rather than in the get_unmapped_area() path so it only needs to go in one
place, than separately in the half-dozen or so arch-specific
implementations of hugetlb_get_unmapped_area().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-31 01:42:23 -07:00
..
boot_ioremap.c [PATCH] paravirt: Add MMU virtualization to paravirt_ops 2006-12-07 02:14:08 +01:00
discontig.c x86: Fix discontigmem + non-HIGHMEM compile 2007-05-15 18:45:49 -07:00
extable.c [PATCH] i386: Allow a kernel not to be in ring 0 2006-09-26 10:52:39 +02:00
fault.c Fix lazy mode vmalloc synchronization for paravirt 2007-08-22 11:10:47 -07:00
highmem.c [PATCH] i386: PARAVIRT: flush lazy mmu updates on kunmap_atomic 2007-05-02 19:27:15 +02:00
hugetlbpage.c hugepage: fix broken check for offset alignment in hugepage mappings 2007-08-31 01:42:23 -07:00
init.c Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION 2007-07-29 16:45:38 -07:00
ioremap.c i386: fix iounmap's use of vm_struct's size field 2007-07-21 18:37:14 -07:00
Makefile [PATCH] sparsemem memory model for i386 2005-06-23 09:45:05 -07:00
mmap.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
pageattr.c x86: Disable CLFLUSH support again 2007-08-11 15:58:13 -07:00
pgtable.c i386: pgd_{c,d}tor() static 2007-07-21 18:37:12 -07:00