From 90648a47e26fb1b43b3ba88eebf8547289674781 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Sun, 19 May 2019 13:05:52 +0800 Subject: [PATCH] fsck.f2fs: fix to repair cp_loads blocks at correct position Let's fix the wrong start offset of cp_payload blocks in fix_checkpoint(). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fsck/fsck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 07657b8..1dd3c01 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -2059,8 +2059,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); } -- 2.7.4