Skip to contentSkip to conversation

f2fs: compress: fix to free compress page correctly

PATCH New Chao Yu 1 participant 1 message May 6, 2021 F2FS file system

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs: compress: fix to free compress page correctly

In error path of f2fs_write_compressed_pages(), it needs to call f2fs_compress_free_page() to release temporary page.

Fixes 5e6bbde95982 ("f2fs: introduce mempool for {,de}compress intermediate page allocation")
---
 fs/f2fs/compress.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/compress.c +2 -1
index d911dff24253..e15ada12d1e8 100644
@@ -1382,7 +1382,8 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc,
 	for (i = 0; i < cc->nr_cpages; i++) {
 		if (!cc->cpages[i])
 			continue;
-		f2fs_put_page(cc->cpages[i], 1);
+		f2fs_compress_free_page(cc->cpages[i]);
+		cc->cpages[i] = NULL;
 	}
 out_put_cic:
 	kmem_cache_free(cic_entry_slab, cic);
Signature · 1 line
2.29.2