Skip to content

Commit

Permalink
cifs: fix page refcount leak
Browse files Browse the repository at this point in the history
Commit 315e995 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>
  • Loading branch information
Jeff Layton authored and Steve French committed Jun 1, 2010
1 parent 67a3e12 commit 06b4367
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 06b4367

Please sign in to comment.