Re: [PATCH V2 1/2] f2fs: compress: relocate some judgments in f2fs_reserve_compress_blocks

From: Chao Yu
Date: Wed Mar 06 2024 - 01:01:37 EST


On 2024/3/6 11:47, Xiuhong Wang wrote:
The following f2fs_io test will get a "0" result instead of -EINVAL,
unisoc # ./f2fs_io compress file
unisoc # ./f2fs_io reserve_cblocks file
0
it's not reasonable, so the judgement of
atomic_read(&F2FS_I(inode)->i_compr_blocks) should be placed after
the judgement of is_inode_flag_set(inode, FI_COMPRESS_RELEASED).

Fixes: c75488fb4d82 ("f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS")
Signed-off-by: Xiuhong Wang <xiuhong.wang@xxxxxxxxxx>
Signed-off-by: Zhiguo Niu <zhiguo.niu@xxxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,