fsck.f2fs: fix losing journal entries

If fsck.f2fs reports a bug, move_curseg_info tries to change the current
segment info.
When it changes the new summary block, it overwrites the existing journal
entries.
This patch fixes it not to overwrite journal entry space.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
diff --git a/fsck/mount.c b/fsck/mount.c
index d2f1432..fe68f37 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -1438,6 +1438,7 @@
 	/* update summary blocks having nullified journal entries */
 	for (i = 0; i < NO_CHECK_TYPE; i++) {
 		struct curseg_info *curseg = CURSEG_I(sbi, i);
+		struct f2fs_summary_block buf;
 		u32 old_segno;
 		u64 ssa_blk, to;
 
@@ -1457,9 +1458,11 @@
 
 		/* update new segno */
 		ssa_blk = GET_SUM_BLKADDR(sbi, curseg->segno);
-		ret = dev_read_block(curseg->sum_blk, ssa_blk);
+		ret = dev_read_block(&buf, ssa_blk);
 		ASSERT(ret >= 0);
 
+		memcpy(curseg->sum_blk, &buf, SUM_ENTRIES_SIZE);
+
 		/* update se->types */
 		reset_curseg(sbi, i);