]> git.baikalelectronics.ru Git - kernel.git/commitdiff
f2fs: compress: fix to free compress page correctly
authorChao Yu <yuchao0@huawei.com>
Thu, 6 May 2021 09:00:43 +0000 (17:00 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 11 May 2021 21:48:12 +0000 (14:48 -0700)
In error path of f2fs_write_compressed_pages(), it needs to call
f2fs_compress_free_page() to release temporary page.

Fixes: 61b2715b635e ("f2fs: introduce mempool for {,de}compress intermediate page allocation")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/compress.c

index 53b13787eb2c8f774a1cb3f3f5a14df8ceff5f0c..2acaefa100364f9f972106c1e1c72bc99306a373 100644 (file)
@@ -1372,7 +1372,8 @@ out_destroy_crypt:
        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);