diff --git a/mm/mmap.c b/mm/mmap.c index bf2298de8a0f..26cff775c25a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2902,6 +2902,8 @@ cannot_expand: if (vma->vm_file) i_mmap_lock_write(vma->vm_file->f_mapping); + /* Lock the VMA since it is modified after insertion into VMA tree */ + vma_start_write(vma); mas_store_prealloc(&mas, vma); mm->map_count++; if (vma->vm_file) {