From: Al Viro Date: Tue, 24 Nov 2009 13:45:24 +0000 (-0500) Subject: fix pgoff in "have to relocate" case of mremap() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=935874141df839c706cd6cdc438e85eb69d1525e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git fix pgoff in "have to relocate" case of mremap() Acked-by: Hugh Dickins Signed-off-by: Al Viro --- diff --git a/mm/mremap.c b/mm/mremap.c index 84efffb2d2c4..bbbbbf507ff3 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -495,7 +495,9 @@ unsigned long do_mremap(unsigned long addr, map_flags |= MAP_SHARED; new_addr = get_unmapped_area(vma->vm_file, 0, new_len, - vma->vm_pgoff, map_flags); + vma->vm_pgoff + + ((addr - vma->vm_start) >> PAGE_SHIFT), + map_flags); if (new_addr & ~PAGE_MASK) { ret = new_addr; goto out;