From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [PATCH] cifs: fix page refcount leak Date: Wed, 26 May 2010 02:54:30 +1000 Message-ID: <20100525165430.GG20853@laptop> References: <1274804917-23814-1-git-send-email-jlayton@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: sfrench@gmail.com, shaggy@linux.vnet.ibm.com, linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org To: Jeff Layton Return-path: Received: from cantor2.suse.de ([195.135.220.15]:33867 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756580Ab0EYQyd (ORCPT ); Tue, 25 May 2010 12:54:33 -0400 Content-Disposition: inline In-Reply-To: <1274804917-23814-1-git-send-email-jlayton@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, May 25, 2010 at 12:28:37PM -0400, Jeff Layton wrote: > 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); > > -- > 1.6.6.1