linux/arch/sparc64
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 [SPARC64]: Add .gitignore file for sparc64 boot images. 2006-02-05 00:15:11 -08:00
kernel [SPARC64]: Fix several bugs in MSI handling. 2007-08-30 23:06:51 -07:00
lib [SPARC64]: Niagara-2 optimized copies. 2007-08-16 01:47:25 -07:00
math-emu [SPARC64] math-emu: Delete debugging printk left by previous commit. 2006-03-20 01:13:53 -08:00
mm hugepage: fix broken check for offset alignment in hugepage mappings 2007-08-31 01:42:23 -07:00
oprofile [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
prom [SPARC]: Fix serial console device detection. 2007-07-20 16:59:26 -07:00
solaris unregister_chrdev(): ignore the return value 2007-07-19 10:04:43 -07:00
Kconfig NTP: move the cmos update code into ntp.c 2007-07-21 17:49:15 -07:00
Kconfig.debug Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION 2007-07-29 16:45:38 -07:00
Makefile [SPARC64]: Stop putting -finline-limit=XXX into CFLAGS 2005-12-20 14:53:05 -08:00
defconfig [SPARC64]: Update defconfig. 2007-07-24 13:24:35 -07:00