Skip to contentSkip to conversation

z3fold: fix spinlock unlocking in page reclaim

PATCH New Vitaly Wool 1 participant 1 message Mar 11, 2017 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 z3fold: fix spinlock unlocking in page reclaim

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.

---
 mm/z3fold.c | 1 +
 1 file changed, 1 insertion(+)
mm/z3fold.c +1 -0
index 8970a2f..f9492bc 100644
@@ -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;
 			}
Signature · 7 lines
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>