mm: avoid rewalk in mmap_region

If the iterator has moved to the previous entry, then step forward one
range, back to the gap.

Link: https://lkml.kernel.org/r/20230518145544.1722059-36-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: David Binderman <dcb314@hotmail.com>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Vernon Yang <vernon2gm@gmail.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Liam R. Howlett 2023-05-18 10:55:44 -04:00 коммит произвёл Andrew Morton
Родитель bb5dbd2272
Коммит 5c1c03de1b
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -2606,6 +2606,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
}
cannot_expand:
if (prev)
vma_iter_next_range(&vmi);
/*
* Determine the object being mapped and call the appropriate
* specific mapper. the address has already been validated, but