+ Andrew > On Aug 9, 2019, at 5:34 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> 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@xxxxxx> 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@xxxxxxxxxx> Signed-off-by: Song Liu <songliubraving@xxxxxx> --- 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