From: Liam R. Howlett Date: Mon, 4 Jan 2021 19:45:37 +0000 (-0500) Subject: fs/exec: Use vma_next() instead of linked list X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cee267a7c297a5af7267e4299b5aab32ec45abf5;p=users%2Fjedix%2Flinux-maple.git fs/exec: Use vma_next() instead of linked list Signed-off-by: Liam R. Howlett --- diff --git a/fs/exec.c b/fs/exec.c index 3d3f7d46137cf..3c9dae291b94e 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -681,6 +681,7 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) unsigned long length = old_end - old_start; unsigned long new_start = old_start - shift; unsigned long new_end = old_end - shift; + struct vm_area_struct *next; struct mmu_gather tlb; BUG_ON(new_start > new_end); @@ -708,12 +709,13 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) lru_add_drain(); tlb_gather_mmu(&tlb, mm); + next = vma_next(mm, vma); if (new_end > old_start) { /* * when the old and new regions overlap clear from new_end. */ free_pgd_range(&tlb, new_end, old_end, new_end, - vma->vm_next ? vma->vm_next->vm_start : USER_PGTABLES_CEILING); + next ? next->vm_start : USER_PGTABLES_CEILING); } else { /* * otherwise, clean from old_start; this is done to not touch @@ -722,7 +724,7 @@ static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) * for the others its just a little faster. */ free_pgd_range(&tlb, old_start, old_end, new_end, - vma->vm_next ? vma->vm_next->vm_start : USER_PGTABLES_CEILING); + next ? next->vm_start : USER_PGTABLES_CEILING); } tlb_finish_mmu(&tlb);