[Devel,rh7] tcache: Fix original page invalidation

Submitted by Kirill Tkhai on Aug. 9, 2017, 1:35 p.m.


Message ID 150228571084.30912.9189213548251954714.stgit@localhost.localdomain
State New
Series "tcache: Fix original page invalidation"
Headers show

Commit Message

Kirill Tkhai Aug. 9, 2017, 1:35 p.m.
This branch is for the cases, when tcache_attach_page()
fails. If so, it's need to free just allocated tcache
page, because we are not going to use it anymore. But
original page is freed instead, that is wrong. Fix that.


Fixes: ba2ea161f25b "mm/tcache: use lockless lookups in tcache's page tree"
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
 mm/tcache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/mm/tcache.c b/mm/tcache.c
index a03ed66401a..458d3c45b6a 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -1192,7 +1192,7 @@  static int tcache_cleancache_put_page(int pool_id,
 			copy_highpage(cache_page, page);
 			if (tcache_attach_page(node, index, cache_page)) {
 				if (put_page_testzero(cache_page))
-					tcache_put_page(page);
+					tcache_put_page(cache_page);
 			} else
 				ret = 1;