--- mm/vma.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/vma.h b/mm/vma.h index 819f994cf727..20cb4f91e371 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -141,7 +141,8 @@ static inline int vma_iter_store_gfp(struct vma_iterator *vmi, { if (vmi->mas.status != ma_start && - ((vmi->mas.index > vma->vm_start) || (vmi->mas.last < vma->vm_start))) + ((vmi->mas.index > vma->vm_start) || (vmi->mas.last < vma->vm_start) || + (vmi->mas.last > vma->vm_end))) vma_iter_invalidate(vmi); __mas_set_range(&vmi->mas, vma->vm_start, vma->vm_end - 1); @@ -463,7 +464,8 @@ static inline void vma_iter_store(struct vma_iterator *vmi, #endif if (vmi->mas.status != ma_start && - ((vmi->mas.index > vma->vm_start) || (vmi->mas.last < vma->vm_start))) + ((vmi->mas.index > vma->vm_start) || (vmi->mas.last < vma->vm_start) || + (vmi->mas.last > vma->vm_end))) vma_iter_invalidate(vmi); __mas_set_range(&vmi->mas, vma->vm_start, vma->vm_end - 1); -- 2.46.2