struct vm_area_struct *expand)
{
struct mm_struct *mm = vma->vm_mm;
- struct vm_area_struct *next = find_vma(mm, vma->vm_end);
+ struct vm_area_struct *next_next, *next = find_vma(mm, vma->vm_end);
struct vm_area_struct *orig_vma = vma;
struct address_space *mapping = NULL;
struct rb_root_cached *root = NULL;
* remove_next == 1 is case 1 or 7.
*/
remove_next = 1 + (end > next->vm_end);
+ next_next = find_vma(mm, next->vm_end);
VM_WARN_ON(remove_next == 2 &&
- end != find_vma(mm, next->vm_end)->vm_end);
+ end != next_next->vm_end);
/* trim end to next, for case 6 first pass */
end = next->vm_end;
}
* "next->prev->vm_end" changed and the
* "vma->next" gap must be updated.
*/
- next = find_vma(mm, vma->vm_end);
+ next = next_next;
} else {
/*
* For the scope of the comment "next" and
next = vma;
}
if (remove_next == 2) {
+ vma_changed = false;
remove_next = 1;
end = next->vm_end;
goto again;