cifs: fix page refcount leak
authorJeff Layton <jlayton@redhat.com>
Tue, 1 Jun 2010 14:54:45 +0000 (10:54 -0400)
committerSteve French <sfrench@us.ibm.com>
Tue, 1 Jun 2010 17:15:52 +0000 (17:15 +0000)
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>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/file.c

index f1ff785b22924d8ccb736fd7794f8c424c2b32c0..75541af4b3db1395ecfab6fd318144b88b959fd8 100644 (file)
@@ -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);