Merge tag 'mm-stable-2023-04-27-15-30' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / mm / mmap.c
index 536bbb8fa0aefeb754c70291c098aff10d4b4688..5522130ae6065d256c8cd80616378137c417132f 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1008,7 +1008,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm,
                        vma = next;                     /* case 3 */
                        vma_start = addr;
                        vma_end = next->vm_end;
-                       vma_pgoff = next->vm_pgoff;
+                       vma_pgoff = next->vm_pgoff - pglen;
                        if (curr) {                     /* case 8 */
                                vma_pgoff = curr->vm_pgoff;
                                remove = curr;