public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 6/18] fix pgoff in "have to relocate" case of mremap()
@ 2009-12-05 19:13 Al Viro
  2009-12-05 19:13 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2009-12-05 19:13 UTC (permalink / raw)
  To: linux-arch; +Cc: torvalds, linux-kernel


Signed-off-by: Al Viro <viro@zeniv.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [RFC][PATCH 6/18] fix pgoff in "have to relocate" case of mremap()
  2009-12-05 19:13 [RFC][PATCH 6/18] fix pgoff in "have to relocate" case of mremap() Al Viro
@ 2009-12-05 19:13 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2009-12-05 19:13 UTC (permalink / raw)
  To: linux-arch; +Cc: torvalds, linux-kernel


Signed-off-by: Al Viro <viro@zeniv.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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-05 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-05 19:13 [RFC][PATCH 6/18] fix pgoff in "have to relocate" case of mremap() Al Viro
2009-12-05 19:13 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox