Update callers to vma_expand() to set the vma iterator to the correct
position. Detect the incorrect location with a MAS_WARN_ON() to debug
what is going on.
Update the caller in shift_arg_pages() to set the vma iterator
correctly.
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
if (vma != vma_next(&vmi))
return -EFAULT;
+ vma_iter_prev_range(&vmi);
+
/*
* cover the whole range: [new_start, old_end)
*/
vma_prepare(&vp);
vma_adjust_trans_huge(vma, start, end, 0);
- /* VMA iterator points to previous, so set to start if necessary */
- if (vma_iter_addr(vmi) != start)
+ if (MAS_WARN_ON(&vmi->mas, vma_iter_addr(vmi) != start))
vma_iter_set(vmi, start);
vma->vm_start = start;