Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cifs: fix page refcount leak

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>

authored by

Jeff Layton and committed by
Steve French
06b43672 67a3e12b

+1
+1
fs/cifs/file.c
··· 1952 1952 bytes_read -= PAGE_CACHE_SIZE; 1953 1953 continue; 1954 1954 } 1955 + page_cache_release(page); 1955 1956 1956 1957 target = kmap_atomic(page, KM_USER0); 1957 1958