]> 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)
commit06b1106df3ea79aa5f7de0323226ca1d3d7e476f
treecc6c26751f0ce276a15e4e79a165689be7cbb440
parent86f473c8cb79a93bd839a53dcafa242af72bedd1
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: bb7c2f5d2e9d ("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