|
@@ -732,7 +732,10 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
|
|
|
if (prev) {
|
|
|
vma = prev;
|
|
|
next = vma->vm_next;
|
|
|
- continue;
|
|
|
+ if (mpol_equal(vma_policy(vma), new_pol))
|
|
|
+ continue;
|
|
|
+ /* vma_merge() joined vma && vma->next, case 8 */
|
|
|
+ goto replace;
|
|
|
}
|
|
|
if (vma->vm_start != vmstart) {
|
|
|
err = split_vma(vma->vm_mm, vma, vmstart, 1);
|
|
@@ -744,6 +747,7 @@ static int mbind_range(struct mm_struct *mm, unsigned long start,
|
|
|
if (err)
|
|
|
goto out;
|
|
|
}
|
|
|
+ replace:
|
|
|
err = vma_replace_policy(vma, new_pol);
|
|
|
if (err)
|
|
|
goto out;
|