mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
z3fold: fix spinlock unlocking in page reclaim
Commmit5a27aa8220
("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:5a27aa8220
("z3fold: add kref refcounting") Link: http://lkml.kernel.org/r/20170311222239.7b83d8e7ef1914e05497649f@gmail.com Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Vitaly Wool <vitalywool@gmail.com> Cc: Dan Streetman <ddstreet@ieee.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
69eea5a4ab
commit
271df90e4e
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue