Re: [f2fs-dev] [PATCH 2/2] f2fs: should put a page beyond EOF when preparing a write

From: Chao Yu
Date: Mon Aug 30 2021 - 22:04:29 EST


On 2021/8/31 8:53, Jaegeuk Kim wrote:
The prepare_compress_overwrite() gets/locks a page to prepare a read, and calls
f2fs_read_multi_pages() which checks EOF first. If there's any page beyond EOF,
we unlock the page and set cc->rpages[i] = NULL, which we can't put the page
anymore. This makes page leak, so let's fix by putting that page.


Fixes: a949dc5f2c5c ("f2fs: compress: fix race condition of overwrite vs truncate")

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

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,