f2fs: compress: fix to update i_compr_blocks correctly
authorChao Yu <chao@kernel.org>
Mon, 6 May 2024 10:41:36 +0000 (18:41 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 10 May 2024 03:38:27 +0000 (03:38 +0000)
commit186e7d71534df4589405925caca5597af7626c12
tree46404f26a8acad2b6cd0ce72087a3d572904e6d6
parent4ed886b187f47447ad559619c48c086f432d2b77
f2fs: compress: fix to update i_compr_blocks correctly

Previously, we account reserved blocks and compressed blocks into
@compr_blocks, then, f2fs_i_compr_blocks_update(,compr_blocks) will
update i_compr_blocks incorrectly, fix it.

Meanwhile, for the case all blocks in cluster were reserved, fix to
update dn->ofs_in_node correctly.

Fixes: eb8fbaa53374 ("f2fs: compress: fix to check unreleased compressed cluster")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c