stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][stable-4.1/3.18] mm/swap.c: Fix a copy&paste error during backport
@ 2016-07-23  9:30 Huacai Chen
  2016-07-23 16:42 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Huacai Chen @ 2016-07-23  9:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Lukasz Odzioba, Sasha Levin, stable, Huacai Chen

When backport 8f182270dfec432e ("mm/swap.c: flush lru pvecs on compound
page arrival") to 4.1/3.18 stable branches, there is a copy&paste error
which will cause memory leak and then an OOM.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
 mm/swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swap.c b/mm/swap.c
index b523f0a..ab3b9c2 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -631,7 +631,7 @@ static void __lru_cache_add(struct page *page)
 	struct pagevec *pvec = &get_cpu_var(lru_add_pvec);
 
 	page_cache_get(page);
-	if (!pagevec_space(pvec) || PageCompound(page))
+	if (!pagevec_add(pvec, page) || PageCompound(page))
 		__pagevec_lru_add(pvec);
 	put_cpu_var(lru_add_pvec);
 }
-- 
2.7.0




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-24 20:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-23  9:30 [PATCH][stable-4.1/3.18] mm/swap.c: Fix a copy&paste error during backport Huacai Chen
2016-07-23 16:42 ` Greg Kroah-Hartman
2016-07-24 13:30   ` Sebastian Gottschall
2016-07-24 20:41     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).