* [PATCH] cifs: fix page refcount leak
@ 2010-05-25 16:28 Jeff Layton
2010-05-25 16:54 ` Nick Piggin
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2010-05-25 16:28 UTC (permalink / raw)
To: sfrench; +Cc: npiggin, shaggy, linux-cifs-client, linux-fsdevel
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 <jlayton@redhat.com>
Cc: Nick Piggin <npiggin@suse.de>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cifs: fix page refcount leak
2010-05-25 16:28 [PATCH] cifs: fix page refcount leak Jeff Layton
@ 2010-05-25 16:54 ` Nick Piggin
0 siblings, 0 replies; 2+ messages in thread
From: Nick Piggin @ 2010-05-25 16:54 UTC (permalink / raw)
To: Jeff Layton; +Cc: sfrench, shaggy, linux-cifs-client, linux-fsdevel
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 <jlayton@redhat.com>
> Cc: Nick Piggin <npiggin@suse.de>
Acked-by: Nick Piggin <npiggin@suse.de>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-25 16:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 16:28 [PATCH] cifs: fix page refcount leak Jeff Layton
2010-05-25 16:54 ` Nick Piggin
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).