fsck.f2fs: check nat_bits separately from bug_on

It checks nat_bits separately, and enable it seamlessly.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim 2018-11-28 15:11:28 -08:00
parent 05779015ae
commit 870817c410
3 changed files with 3 additions and 2 deletions

View File

@ -2676,7 +2676,7 @@ int fsck_verify(struct f2fs_sb_info *sbi)
if (force || (c.fix_on && !c.ro)) {
struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
if (force || c.bug_on) {
if (force || c.bug_on || c.bug_nat_bits) {
/* flush nats to write_nit_bits below */
flush_journal_entries(sbi);
fix_hard_links(sbi);

View File

@ -1242,7 +1242,7 @@ out:
if (!err) {
MSG(0, "Info: Checked valid nat_bits in checkpoint\n");
} else {
c.bug_on = 1;
c.bug_nat_bits = 1;
MSG(0, "Info: Corrupted valid nat_bits in checkpoint\n");
}
return err;

View File

@ -372,6 +372,7 @@ struct f2fs_configuration {
int force;
int defset;
int bug_on;
int bug_nat_bits;
int alloc_failed;
int auto_fix;
int quota_fix;