2022-07-20 07:18:18

by Zeng Jingxiang

[permalink] [raw]
Subject: [PATCH] mm/z3fold: do not unlock in z3fold_page_putback()

From: Zeng Jingxiang <[email protected]>

z3fold_page_lock() will lock zhdr->page_lock
1630 z3fold_page_lock(zhdr);

return without unlocking zhdr->page_lock
1634 if (kref_put(&zhdr->refcount, release_z3fold_page_locked))
1635 return;

Signed-off-by: Zeng Jingxiang <[email protected]>
---
mm/z3fold.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/z3fold.c b/mm/z3fold.c
index f41f8b0d9e9a..03785832ad47 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1632,13 +1632,14 @@ static void z3fold_page_putback(struct page *page)
list_del_init(&zhdr->buddy);
INIT_LIST_HEAD(&page->lru);
if (kref_put(&zhdr->refcount, release_z3fold_page_locked))
- return;
+ goto ret;
spin_lock(&pool->lock);
list_add(&page->lru, &pool->lru);
spin_unlock(&pool->lock);
if (list_empty(&zhdr->buddy))
add_to_unbuddied(pool, zhdr);
clear_bit(PAGE_CLAIMED, &page->private);
+ret:
z3fold_page_unlock(zhdr);
}

--
2.27.0