mm: thp: fix a double unlock bug
Subsystems (3)
PATCH 1/1 mm: thp: fix a double unlock bug
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.
--- mm/huge_memory.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
mm/huge_memory.c +1 -3
@@ -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)
Signature · 1 line
2.30.2
Quoted 5 lines · Dan Carpenter
We're supposed to be holding the "
vmf->ptl"spin_lockwhen we gotoout_map. The lock is dropped after if finishes cleaning up.Fixes 9aff7b33c74a ("mm: thp: refactor NUMA fault handling")Signed-off-by Dan Carpenter <[email protected]>
Ouch.
However, that git commit is not stable. Instead of Fixes: I would suggest renaming the patch to "mm: thp: refactor NUMA fault handling -fix" and replacing Fixes with "This patch is a fix to the mmotm patch mm-thp-refactor-numa-fault-handling.patch". Andrew usually slots that into the correct place in his quilt series and collapses the fixes before sending to Linus which works better with bisection.
Signature · 2 lines
Mel Gorman SUSE Labs
Quoted 9 lines · Mel Gorman
Quoted 5 lines · Dan Carpenter
We're supposed to be holding the "
vmf->ptl"spin_lockwhen we gotoout_map. The lock is dropped after if finishes cleaning up.Fixes 9aff7b33c74a ("mm: thp: refactor NUMA fault handling")Signed-off-by Dan Carpenter <[email protected]>Ouch.
Quoted 8 lines
Acked-by Mel Gorman <[email protected]>However, that git commit is not stable. Instead of Fixes: I would suggest renaming the patch to "mm: thp: refactor NUMA fault handling -fix" and replacing Fixes with "This patch is a fix to the mmotm patch mm-thp-refactor-numa-fault-handling.patch". Andrew usually slots that into the correct place in his quilt series and collapses the fixes before sending to Linus which works better with bisection.
I know that these normally get folded in, but I assumed that Andrew would want the Fixes tag so that he could fold them in automatically using a mutt alias. #OneClickShopping
regards,
dan carpenter
Quoted 6 lines · Dan Carpenter
We're supposed to be holding the "
vmf->ptl"spin_lockwhen we gotoout_map. The lock is dropped after if finishes cleaning up.Fixes 9aff7b33c74a ("mm: thp: refactor NUMA fault handling")Signed-off-by Dan Carpenter <[email protected]>
Thanks for catching this. Acked-by: Yang Shi <[email protected]>
Quoted 23 lines
--- mm/huge_memory.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)mm/huge_memory.c +1
-4@@ -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