From c5765faf95c70caf867b4672c8a54d3d7fc8072c Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 1 Jun 2010 10:54:45 -0400 Subject: [PATCH] cifs: fix page refcount leak Commit 4ae858484c99840d6b4a079b7755ff7dadcd465b is causing OOM kills when stress-testing a CIFS filesystem. The VFS readpages operation takes a page reference. The older code just handed this reference off to the page cache, but the new code takes an extra one. The simplest fix is to put the new reference after add_to_page_cache_lru. Signed-off-by: Jeff Layton Acked-by: Nick Piggin Signed-off-by: Steve French --- fs/cifs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index f1ff785b22924..75541af4b3db1 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1952,6 +1952,7 @@ static void cifs_copy_cache_pages(struct address_space *mapping, bytes_read -= PAGE_CACHE_SIZE; continue; } + page_cache_release(page); target = kmap_atomic(page, KM_USER0); -- 2.39.5