Skip to content

Commit

Permalink
fix pgoff in "have to relocate" case of mremap()
Browse files Browse the repository at this point in the history
Acked-by: Hugh Dickins <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Dec 11, 2009
1 parent 097eed1 commit 9358741
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/mremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9358741

Please sign in to comment.