lkml.org 
[lkml]   [2021]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm: thp: fix a double unlock bug
On Tue, Jun 1, 2021 at 2:24 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> We're supposed to be holding the "vmf->ptl" spin_lock when we goto
> out_map. The lock is dropped after if finishes cleaning up.
>
> Fixes: 9aff7b33c74a ("mm: thp: refactor NUMA fault handling")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for catching this. Acked-by: Yang Shi <shy828301@gmail.com>

> ---
> mm/huge_memory.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index e353bbc6cee3..caa0148f15bb 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -1465,10 +1465,8 @@ vm_fault_t do_huge_pmd_numa_page(struct vm_fault *vmf)
>
> pmd = pmd_modify(oldpmd, vma->vm_page_prot);
> page = vm_normal_page_pmd(vma, haddr, pmd);
> - if (!page) {
> - spin_unlock(vmf->ptl);
> + if (!page)
> goto out_map;
> - }
>
> /* See similar comment in do_numa_page for explanation */
> if (!was_writable)
> --
> 2.30.2
>

\
 
 \ /
  Last update: 2021-06-01 19:31    [W:0.070 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site