linux-stable-rt/arch/ia64
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
..
configs [IA64] Update arch/ia64/configs/* s/SLAB/SLUB/ 2007-08-13 14:54:34 -07:00
dig
hp [IA64] make unwinder stop at last frame of the bootloader 2007-08-13 13:26:02 -07:00
ia32 [IA64] Remove a few duplicate includes 2007-07-30 16:28:59 -07:00
kernel [IA64] Enable early console for Ski simulator 2007-08-17 13:44:15 -07:00
lib
mm hugepage: fix broken check for offset alignment in hugepage mappings 2007-08-31 01:42:23 -07:00
oprofile
pci [IA64] Nail two more simple section mismatch errors 2007-07-25 13:08:41 -07:00
scripts
sn [IA64] SGI Altix : fix a force_interrupt bug on altix 2007-08-13 15:24:35 -07:00
Kconfig [IA64] Include Kconfig.preempt 2007-08-13 13:20:38 -07:00
Kconfig.debug
Makefile
defconfig [IA64] Update arch/ia64/configs/* s/SLAB/SLUB/ 2007-08-13 14:54:34 -07:00
install.sh
module.lds