kernel-fxtec-pro1x/arch/i386
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 [x86 setup] Make sure AH=00h when setting a video mode 2007-08-23 13:03:25 -07:00
crypto
kernel Pull bugzilla-1641 into release branch 2007-08-24 22:19:05 -04:00
lib i386: Move all simple string operations out of line 2007-07-21 18:37:08 -07:00
mach-default
mach-es7000
mach-generic kbuild: remove hardcoded apic_es7000 from modpost 2007-07-16 23:24:51 +02:00
mach-visws
mach-voyager usermodehelper: Tidy up waiting 2007-07-18 08:47:40 -07:00
math-emu
mm hugepage: fix broken check for offset alignment in hugepage mappings 2007-08-31 01:42:23 -07:00
oprofile
pci i386: Fix broken mmiocfg accesses 2007-08-12 02:23:16 -07:00
power Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION 2007-07-29 16:45:38 -07:00
video fbcon: allow fbcon to use the primary display driver 2007-07-17 10:23:11 -07:00
xen Xen i386 xen-head.S fix sections mixup 2007-08-22 19:52:47 -07:00
defconfig i386: Update defconfig 2007-07-21 18:37:07 -07:00
Kconfig i386: Mark NUMA support experimental 2007-08-21 10:06:44 -07:00
Kconfig.cpu i386: Allow KVM on i386 nonpae 2007-07-19 14:37:05 -07:00
Kconfig.debug Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION 2007-07-29 16:45:38 -07:00
Makefile x86_64: Check for .cfi_rel_offset in CFI probe 2007-08-18 10:25:25 -07:00
Makefile.cpu