[Devel] [PATCH rh7] tcache: Fix original page invalidation

Kirill Tkhai ktkhai at virtuozzo.com
Wed Aug 9 16:35:26 MSK 2017


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.

https://jira.sw.ru/browse/PSBM-69852

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

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;
 		}



More information about the Devel mailing list