linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Linux MM <linux-mm@kvack.org>, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [bug report] mm,thp: add read-only THP support for (non-shmem) FS
Date: Fri, 9 Aug 2019 14:24:30 +0000	[thread overview]
Message-ID: <B960CBFA-8EFC-4DA4-ABC5-1977FFF2CA57@fb.com> (raw)
In-Reply-To: <20190809123441.GA9573@mwanda>

+ Andrew

> On Aug 9, 2019, at 5:34 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> Hello Song Liu,
> 
> The patch 89e1c65c0db7: "mm,thp: add read-only THP support for
> (non-shmem) FS" from Aug 7, 2019, leads to the following static
> checker warning:
> 
> 	mm/khugepaged.c:1532 collapse_file()
> 	error: double unlock 'irq:'
> 
[...]

Thanks Dan! The following patch fixes this issue. 

Hi Andrew, could you please add this fix to the mm tree?

Thanks,
Song


================= 8< ======================

From 30fd3683bb62cb81bb144e945edb768aff7ca445 Mon Sep 17 00:00:00 2001
From: Song Liu <songliubraving@fb.com>
Date: Fri, 9 Aug 2019 07:15:17 -0700
Subject: [PATCH] khugepaged: fix double unlock in collapse_file()

In collapse_file, when try_to_release_page() fails, we need to goto
out_unlock, because we already called xas_unlock_irq().

Fixes: 89e1c65c0db7 ("mm,thp: add read-only THP support for (non-shmem) FS")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 40c25ddf29e4..f3b94a5a9c43 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1472,7 +1472,7 @@ static void collapse_file(struct mm_struct *mm,
                if (page_has_private(page) &&
                    !try_to_release_page(page, GFP_KERNEL)) {
                        result = SCAN_PAGE_HAS_PRIVATE;
-                       break;
+                       goto out_unlock;
                }

                if (page_mapped(page))
--
2.17.1


      reply	other threads:[~2019-08-09 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 12:34 Dan Carpenter
2019-08-09 14:24 ` Song Liu [this message]

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=B960CBFA-8EFC-4DA4-ABC5-1977FFF2CA57@fb.com \
    --to=songliubraving@fb.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-mm@kvack.org \
    /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