diff options
| author | David Gibson <[email protected]> | 2007-08-30 23:56:40 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2007-08-31 01:42:23 -0700 |
| commit | dec4ad86c2fbea062e9ef9caa6d6e79f7c5e0b12 (patch) | |
| tree | 9882d3b1f59fb293cf0f70afc80bdc7bb1e0021e /net/lapb/lapb_out.c | |
| parent | 4a58448b0a375f7198de34dd0d3e2881afeaf025 (diff) | |
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 68589bc353037f233fe510ad9ff432338c95db66, 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 4b1d89290b62bb2db476c94c82cf7442aab440c8, 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 <[email protected]>
Cc: Adam Litke <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions