linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Yang Shi <shy828301@gmail.com>
Cc: Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH] mm: thp: fix a double unlock bug
Date: Tue, 1 Jun 2021 12:24:09 +0300	[thread overview]
Message-ID: <YLX8uYN01JmfLnlK@mwanda> (raw)

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>
---
 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


             reply	other threads:[~2021-06-01  9:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  9:24 Dan Carpenter [this message]
2021-06-01 10:08 ` [PATCH] mm: thp: fix a double unlock bug Mel Gorman
2021-06-01 10:43   ` Dan Carpenter
2021-06-01 17:30 ` Yang Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLX8uYN01JmfLnlK@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=shy828301@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).