linux/include
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
..
acpi Pull events into release branch 2007-08-25 01:44:01 -04:00
asm-alpha Fix Alpha O_CLOEXEC definition 2007-08-09 08:39:22 -07:00
asm-arm Merge branch 'omap-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2007-08-25 12:38:47 +01:00
asm-avr32 [AVR32] Define mmiowb() 2007-08-15 16:36:56 +02:00
asm-blackfin remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
asm-cris remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
asm-frv FRV: connect up fallocate 2007-08-11 15:47:40 -07:00
asm-generic changing include/asm-generic/pgtable.h for non-mmu 2007-08-11 15:47:42 -07:00
asm-h8300 remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
asm-i386 Pull bugzilla-1641 into release branch 2007-08-24 22:19:05 -04:00
asm-ia64 [IA64] SN2 needs platform specific irq_to_vector() function. 2007-08-13 10:31:26 -07:00
asm-m32r remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
asm-m68k m68k: Enable arbitary speed tty support 2007-08-22 19:52:45 -07:00
asm-m68knommu m68knommu: include asm-generic/pgtable.h 2007-08-23 21:32:54 -07:00
asm-mips [MIPS] Polish <asm/edac.h>. 2007-08-27 02:16:59 +01:00
asm-parisc [PARISC] Add dummy isa_(bus|virt)_to_(virt|bus) inlines 2007-08-27 00:29:22 -04:00
asm-powerpc [POWERPC] Fix FSL BookE machine check reporting 2007-08-17 13:22:28 -05:00
asm-ppc [WATCHDOG] mv64x60_wdt: Add arch/powerpc platform support 2007-07-24 21:16:02 +00:00
asm-s390 [S390] Change atomic_read/set to inline functions with barrier semantics. 2007-08-22 13:51:49 +02:00
asm-sh sh: Add missing dma_sync_single_range_for_*(). 2007-08-10 02:37:01 +09:00
asm-sh64 sh64: Add missing dma_sync_single_for_*(). 2007-08-10 02:47:31 +09:00
asm-sparc [SPARC32]: Make flush_tlb_kernel_range() an inline function. 2007-08-26 18:49:12 -07:00
asm-sparc64 [SPARC64]: Fix several bugs in MSI handling. 2007-08-30 23:06:51 -07:00
asm-um uml: fix x86_64 core dump crash 2007-08-31 01:42:22 -07:00
asm-v850 remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
asm-x86_64 Pull bugzilla-1641 into release branch 2007-08-24 22:19:05 -04:00
asm-xtensa remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
crypto [CRYPTO] cryptd: Add software async crypto daemon 2007-05-02 14:38:32 +10:00
keys [AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both 2007-04-26 15:48:28 -07:00
linux hugepage: fix broken check for offset alignment in hugepage mappings 2007-08-31 01:42:23 -07:00
math-emu Fix <math-emu/soft-fp.h> tpyo 2007-08-18 17:15:17 -07:00
media V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22) 2007-07-18 14:24:44 -03:00
mtd UBI: kill homegrown endian macros 2007-07-18 16:53:49 +03:00
net SCTP: Fix to encode PROTOCOL VIOLATION error cause correctly 2007-08-30 13:50:48 -04:00
pcmcia PCMCIA-NETDEV : add new ID of lan&modem multifunction card 2007-07-08 22:16:39 -04:00
rdma IB: Move the macro IB_UMEM_MAX_PAGE_CHUNK() to umem.c 2007-08-03 10:45:18 -07:00
rxrpc [AF_RXRPC]: Delete the old RxRPC code. 2007-04-26 15:55:48 -07:00
scsi [SCSI] sd: disentangle barriers in SCSI 2007-08-04 08:37:04 -05:00
sound [ALSA] version 1.0.14 2007-07-20 11:13:35 +02:00
video remove tx3912fb 2007-07-31 15:39:41 -07:00
xen xen: xen/page.h compile fix 2007-07-26 11:35:16 -07:00
Kbuild