fs/hugetlbfs/inode.c: fix pgoff alignment checking on 32-bit
authorBecky Bruce <beckyb@kernel.crashing.org>
Tue, 26 Jul 2011 00:11:49 +0000 (17:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 03:57:07 +0000 (20:57 -0700)
commit2b37c35e6552b0d04d5db9728bc7af22d53f731a
tree5ccccfe90e6bfb472e6000fd4f55c9be66eb795c
parentd694ad62bf539dbb20a0899ac2a954555f9e4a83
fs/hugetlbfs/inode.c: fix pgoff alignment checking on 32-bit

This:

    vma->vm_pgoff & ~(huge_page_mask(h) >> PAGE_SHIFT)

is incorrect on 32-bit.  It causes us to & the pgoff with something that
looks like this (for a 4m hugepage): 0xfff003ff.  The mask should be
flipped and *then* shifted, to give you 0x0000_03fff.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
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>
fs/hugetlbfs/inode.c