[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1505060436-45299-1-git-send-email-yunlong.song@huawei.com>
Date: Mon, 11 Sep 2017 00:20:36 +0800
From: Yunlong Song <yunlong.song@...wei.com>
To: <jaegeuk@...nel.org>, <chao@...nel.org>, <yuchao0@...wei.com>,
<yunlong.song@...oud.com>, <yunlong.song@...wei.com>
CC: <miaoxie@...wei.com>, <bintian.wang@...wei.com>,
<linux-fsdevel@...r.kernel.org>,
<linux-f2fs-devel@...ts.sourceforge.net>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] f2fs-tools: move_curseg_info only if check_curseg_offset fails
Current design will lose recovery process when check_curseg_offset is OK.
Signed-off-by: Yunlong Song <yunlong.song@...wei.com>
---
fsck/fsck.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index cb341ba..56a47be 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -2026,9 +2026,11 @@ int fsck_verify(struct f2fs_sb_info *sbi)
fix_hard_links(sbi);
fix_nat_entries(sbi);
rewrite_sit_area_bitmap(sbi);
- move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
- write_curseg_info(sbi);
- flush_curseg_sit_entries(sbi);
+ if (check_curseg_offset(sbi)) {
+ move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
+ write_curseg_info(sbi);
+ flush_curseg_sit_entries(sbi);
+ }
fix_checkpoint(sbi);
} else if (is_set_ckpt_flags(cp, CP_FSCK_FLAG)) {
write_checkpoint(sbi);
--
1.8.5.2
Powered by blists - more mailing lists