]> 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>
Tue, 5 Jan 2021 17:30:32 +0000 (12:30 -0500)
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 966bc88d344f1c2518fd6089dc48a24ae11ee627..8b0631aa70c83db4bfce5c49c3bc30d7e3eab4b2 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);