]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: Fix memory leak when using fscache
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 18 Jul 2022 19:06:24 +0000 (20:06 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 1 Aug 2022 06:34:44 +0000 (01:34 -0500)
commit373fcd64326bad2bf980bb1d9424733bc497a010
treecc6c26751f0ce276a15e4e79a165689be7cbb440
parent4fe4231b032280fb4c311bc947c82b531022dad9
cifs: Fix memory leak when using fscache

If we hit the 'index == next_cached' case, we leak a refcount on the
struct page.  Fix this by using readahead_folio() which takes care of
the refcount for you.

Fixes: c29d5b413824 ("cifs: Implement cache I/O by accessing the cache directly")
Cc: David Howells <dhowells@redhat.com>
Cc: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/file.c