diff options
author | Liam R. Howlett <Liam.Howlett@Oracle.com> | 2023-01-20 19:26:50 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-10 03:51:38 +0300 |
commit | 18b098af2890cdeab07368405409111197f190d2 (patch) | |
tree | 5d8d1b76b5de2f98406dba67973107ebca194ba1 /mm/mmap.c | |
parent | 0503ea8f5ba73eb3ab13a81c1eefbaf51405385a (diff) | |
download | linux-18b098af2890cdeab07368405409111197f190d2.tar.xz |
vma_merge: set vma iterator to correct position.
When merging the previous value, set the vma iterator to the previous
slot. Don't use the vma iterator to get the next/prev so that it is in
the correct position for a write.
Link: https://lkml.kernel.org/r/20230120162650.984577-50-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 8ce4cee42dce..b698a96d0511 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -932,6 +932,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, && can_vma_merge_after(prev, vm_flags, anon_vma, file, pgoff, vm_userfaultfd_ctx, anon_name)) { merge_prev = true; + vma_prev(vmi); } } /* Can we merge the successor? */ @@ -1023,9 +1024,6 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, validate_mm(mm); khugepaged_enter_vma(res, vm_flags); - if (res) - vma_iter_set(vmi, end); - return res; } |