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(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index 6075d22..10a62fd 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -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);
        }
 
-- 
2.18.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to