]> Git Repo - linux.git/blobdiff - mm/mmap.c
mmc: au1xmmc: force non-modular build and remove symbol_get usage
[linux.git] / mm / mmap.c
index 204ddcd52625a39909c93756461773537e2b61e3..3eda23c9ebe7a60427443fec3c8da8f38c163832 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1977,6 +1977,8 @@ static int expand_upwards(struct vm_area_struct *vma, unsigned long address)
                return -ENOMEM;
        }
 
+       /* Lock the VMA before expanding to prevent concurrent page faults */
+       vma_start_write(vma);
        /*
         * vma->vm_start/vm_end cannot change under us because the caller
         * is required to hold the mmap_lock in read mode.  We need the
@@ -2064,6 +2066,8 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address)
                return -ENOMEM;
        }
 
+       /* Lock the VMA before expanding to prevent concurrent page faults */
+       vma_start_write(vma);
        /*
         * vma->vm_start/vm_end cannot change under us because the caller
         * is required to hold the mmap_lock in read mode.  We need the
@@ -2805,6 +2809,8 @@ cannot_expand:
        if (vma_iter_prealloc(&vmi))
                goto close_and_free_vma;
 
+       /* Lock the VMA since it is modified after insertion into VMA tree */
+       vma_start_write(vma);
        if (vma->vm_file)
                i_mmap_lock_write(vma->vm_file->f_mapping);
 
This page took 0.031387 seconds and 4 git commands to generate.