This patch fixes it.
Signed-off-by: Minchan Kim <minch...@gmail.com>
Cc: KOSAKI Motohiro <kosaki....@jp.fujitsu.com>
Cc: Christoph Lameter <c...@linux-foundation.org>
Cc: Hugh Dickins <hugh.d...@tiscali.co.uk>
---
mm/mempolicy.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 9751f3f..7e529d0 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -570,6 +570,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
struct vm_area_struct *prev;
struct vm_area_struct *vma;
int err = 0;
+ pgoff_t pgoff;
unsigned long vmstart;
unsigned long vmend;
@@ -582,9 +583,9 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
vmstart = max(start, vma->vm_start);
vmend = min(end, vma->vm_end);
+ pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
prev = vma_merge(mm, prev, vmstart, vmend, vma->vm_flags,
- vma->anon_vma, vma->vm_file, vma->vm_pgoff,
- new_pol);
+ vma->anon_vma, vma->vm_file, pgoff, new_pol);
if (prev) {
vma = prev;
next = vma->vm_next;
--
1.6.3.3
--
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Nice catch!
Reviewed-by: KOSAKI Motohiro <kosaki....@jp.fujitsu.com>