linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsck.f2fs: fix to repair cp_loads blocks at correct position
@ 2019-05-19  5:05 Chao Yu
  0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2019-05-19  5:05 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: jaegeuk

From: Chao Yu <yuchao0@huawei.com>

Let's fix the wrong start offset of cp_payload blocks in
fix_checkpoint().

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-19  5:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-19  5:05 [PATCH] fsck.f2fs: fix to repair cp_loads blocks at correct position Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).