]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kernel/fork: Don't take spinlock of maple tree.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 1 Oct 2020 14:03:48 +0000 (10:03 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:12:46 +0000 (15:12 -0400)
You cannot take the spinlock of the maple tree and then allocate VMAs.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
kernel/fork.c

index 09b77bb73bc165bc853769f05d6fe23c3e741e4a..35f13110e2edd003766d31b1a9d22ab1d97e20cc 100644 (file)
@@ -510,7 +510,6 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
        if (retval)
                goto fail_nomem;
 
-       mas_lock(&old_mas);
        mas_for_each(&old_mas, mpnt, ULONG_MAX) {
                struct file *file;
 
@@ -607,7 +606,6 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
        /* a new mm has just been created */
        retval = arch_dup_mmap(oldmm, mm);
 loop_out:
-       mas_unlock(&old_mas);
 out:
        mmap_write_unlock(mm);
        flush_tlb_mm(oldmm);