Commit 93587414 authored by Al Viro's avatar Al Viro

fix pgoff in "have to relocate" case of mremap()

Acked-by: default avatarHugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 097eed10
...@@ -495,7 +495,9 @@ unsigned long do_mremap(unsigned long addr, ...@@ -495,7 +495,9 @@ unsigned long do_mremap(unsigned long addr,
map_flags |= MAP_SHARED; map_flags |= MAP_SHARED;
new_addr = get_unmapped_area(vma->vm_file, 0, new_len, 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) { if (new_addr & ~PAGE_MASK) {
ret = new_addr; ret = new_addr;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment