From patchwork Tue May 25 16:28:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 53555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id 663BFB7D18 for ; Wed, 26 May 2010 02:28:48 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 5E187AD25F; Tue, 25 May 2010 10:28:48 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.8 tests=AWL, BAYES_00 autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.120]) by lists.samba.org (Postfix) with ESMTP id CA002AD204 for ; Tue, 25 May 2010 10:28:41 -0600 (MDT) X-Authority-Analysis: v=1.1 cv=nvPTcbS/1X5sBfqPoji6pWQQw+epcOlfrYAGfc16qa8= c=1 sm=0 a=4x2aL-aievUA:10 a=q8OS1GolVHwA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=Qy9OyuKddcdk0n2Dk58A:9 a=g0Mbu0zaBu-ezvPnQ9kA:7 a=V4S3uCTvUTpyYsR2Fxku6bFvUtIA:4 a=jEp0ucaQiEUA:10 a=0kPLrQdw3YYA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:34165] helo=mail.poochiereds.net) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 7C/EF-28437-6BAFBFB4; Tue, 25 May 2010 16:28:38 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id E817D580BA; Tue, 25 May 2010 12:28:37 -0400 (EDT) From: Jeff Layton To: sfrench@gmail.com Date: Tue, 25 May 2010 12:28:37 -0400 Message-Id: <1274804917-23814-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.6.6.1 Cc: npiggin@suse.de, linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org Subject: [linux-cifs-client] [PATCH] cifs: fix page refcount leak X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@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 Cc: Nick Piggin 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 310533d..29ca398 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1919,6 +1919,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);