]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/madvise: use vma_find() instead of vma linked list
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 22 Aug 2022 15:06:29 +0000 (15:06 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 22 Aug 2022 22:58:28 +0000 (15:58 -0700)
madvise_walk_vmas() no longer uses linked list.

Link: https://lkml.kernel.org/r/20220822150128.1562046-55-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/madvise.c

index af97100a072704e7de41f4877faf78eb7b223618..682e1d161aef987185cf1b0d8739e002ddfe8abf 100644 (file)
@@ -1242,7 +1242,7 @@ int madvise_walk_vmas(struct mm_struct *mm, unsigned long start,
                if (start >= end)
                        break;
                if (prev)
-                       vma = prev->vm_next;
+                       vma = find_vma(mm, prev->vm_end);
                else    /* madvise_remove dropped mmap_lock */
                        vma = find_vma(mm, start);
        }