BACKPORT: f2fs: compress: fix to avoid inconsistence bewteen i_blocks and dnode
In reserve_compress_blocks(), we update blkaddrs of dnode in prior to inc_valid_block_count(), it may cause inconsistent status bewteen i_blocks and blkaddrs once inc_valid_block_count() fails. To fix this issue, it needs to reverse their invoking order. Bug: 428869293 Change-Id: I4a7348803155b5a5cddfd17ec7c08ce0abc64bce Fixes: c75488fb ("f2fs: introduce F2FS_IOC_RESERVE_COMPRESS_BLOCKS") Reviewed-by:Daeho Jeong <daehojeong@google.com> Signed-off-by:
Chao Yu <chao@kernel.org> Signed-off-by:
Jaegeuk Kim <jaegeuk@kernel.org> (cherry picked from commit 54607494) [Chao: Resolved conflicts in fs/f2fs/data.c fs/f2fs/file.c fs/f2fs/segment.c ] Signed-off-by:
Chao Yu <chao@kernel.org> [Qi: This is cherry-pick drops changes to fs/f2fs/segment.c because android12-5.10 f2fs does not have atomic write support.] Signed-off-by:
Qi Han <hanqi@vivo.com>
Loading