Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1598482

[PATCH] z3fold: fix spinlock unlocking in page reclaim

From Vitaly Wool <vitalywool@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] z3fold: fix spinlock unlocking in page reclaim
Date 2017-03-11 22:30 +0100
Message-ID <tjWKl-7E-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The patch "z3fold: add kref refcounting" introduced a bug in
z3fold_reclaim_page() with function exit that may leave pool->lock
spinlock held. Here comes the trivial fix.

Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
---
 mm/z3fold.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/z3fold.c b/mm/z3fold.c
index 8970a2f..f9492bc 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -667,6 +667,7 @@ static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)
 			z3fold_page_unlock(zhdr);
 			spin_lock(&pool->lock);
 			if (kref_put(&zhdr->refcount, release_z3fold_page)) {
+				spin_unlock(&pool->lock);
 				atomic64_dec(&pool->pages_nr);
 				return 0;
 			}
-- 
2.5.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] z3fold: fix spinlock unlocking in page reclaim Vitaly Wool <vitalywool@gmail.com> - 2017-03-11 22:30 +0100

csiph-web