[<prev] [next>] [day] [month] [year] [list]
Message-Id: <E1NH04g-0000RD-W6@ZenIV.linux.org.uk>
Date: Sat, 05 Dec 2009 19:13:46 +0000
From: Al Viro <viro@....linux.org.uk>
To: linux-arch@...r.kernel.org
Cc: torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: [RFC][PATCH 6/18] fix pgoff in "have to relocate" case of
mremap()
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
mm/mremap.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/mm/mremap.c b/mm/mremap.c
index 84efffb..bbbbbf5 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;
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists