fsck.f2fs: fix to repair cp_loads blocks at correct position
PATCH 1/1 fsck.f2fs: fix to repair cp_loads blocks at correct position
From: Chao Yu <[email protected]>
Let's fix the wrong start offset of cp_payload blocks in fix_checkpoint().
Signed-off-by Chao Yu <[email protected]>
--- fsck/fsck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fsck/fsck.c +2 -2
@@ -2104,8 +2104,8 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi)ASSERT (ret >=0 );for (i =0 ; i <get_sb (cp_payload); i++) { - ret =dev_write_block (((unsigned char *)cp) + i *F2FS_BLKSIZE , - cp_blk_no++); + ret =dev_write_block (((unsigned char *)cp) + + (i +1 ) *F2FS_BLKSIZE , cp_blk_no++);ASSERT (ret >=0 ); }
Signature · 1 line
2.18.0