Re: [f2fs-dev] [PATCH 1/2] f2fs: deallocate compressed pages when error happens

From: Chao Yu
Date: Mon Aug 30 2021 - 21:57:10 EST


On 2021/8/31 8:53, Jaegeuk Kim wrote:
In f2fs_write_multi_pages(), f2fs_compress_pages() allocates pages for
compression work in cc->cpages[]. Then, f2fs_write_compressed_pages() initiates
bio submission. But, if there's any error before submitting the IOs like early
f2fs_cp_error(), previously it didn't free cpages by f2fs_compress_free_page().
Let's fix memory leak by putting that just before deallocating cc->cpages.


Fixes: 4c8ff7095bef ("f2fs: support data compression")

Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,