[patch 1/6] z3fold: fix spinlock unlocking in page reclaim

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vitaly Wool <vitalywool@xxxxxxxxx>
Subject: z3fold: fix spinlock unlocking in page reclaim

5a27aa8220290b64 ("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.

Fixes: 5a27aa8220290b ("z3fold: add kref refcounting")
Link: http://lkml.kernel.org/r/20170311222239.7b83d8e7ef1914e05497649f@xxxxxxxxx
Reported-by: Alexey Khoroshilov <khoroshilov@xxxxxxxxx>
Signed-off-by: Vitaly Wool <vitalywool@xxxxxxxxx>
Cc: Dan Streetman <ddstreet@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/z3fold.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN mm/z3fold.c~z3fold-fix-spinlock-unlocking-in-page-reclaim mm/z3fold.c
--- a/mm/z3fold.c~z3fold-fix-spinlock-unlocking-in-page-reclaim
+++ a/mm/z3fold.c
@@ -667,6 +667,7 @@ next:
 			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;
 			}
_
--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux