Hi,
The attached patch fixes page reference leaks when a netfs page is
already found in the cache.
Thanks,
Shantanu
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index ad74a6a..ead4981 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -523,7 +523,10 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
netpage->index, cachefiles_gfp);
if (ret < 0) {
if (ret == -EEXIST) {
+ page_cache_release(backpage);
+ backpage = NULL;
page_cache_release(netpage);
+ netpage = NULL;
fscache_retrieval_complete(op, 1);
continue;
}
@@ -596,7 +599,10 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
netpage->index, cachefiles_gfp);
if (ret < 0) {
if (ret == -EEXIST) {
+ page_cache_release(backpage);
+ backpage = NULL;
page_cache_release(netpage);
+ netpage = NULL;
fscache_retrieval_complete(op, 1);
continue;
}
--
Linux-cachefs mailing list
Linux-cachefs@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cachefs