Skip to contentSkip to conversation

fsck.f2fs: fix to repair cp_loads blocks at correct position

PATCH New Chao Yu 1 participant 1 message May 19, 2019

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

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

---
 fsck/fsck.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fsck/fsck.c +2 -2
index 6075d22..10a62fd 100644
@@ -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