From patchwork Tue Jun 1 14:54:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/8] cifs: fix page refcount leak Date: Tue, 01 Jun 2010 04:54:45 -0000 From: Jeff Layton X-Patchwork-Id: 54217 Message-Id: <1275404092-8400-2-git-send-email-jlayton@redhat.com> To: smfrench@gmail.com Cc: linux-cifs-client@lists.samba.org Commit 315e995c63a15cb4d4efdbfd70fe2db191917f7a 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 --- fs/cifs/file.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index f1ff785..75541af 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);