aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-01-09 02:59:57 -0800
committerEthan Chen <intervigil@gmail.com>2015-05-04 12:35:20 -0700
commitf32207b10d6b7c2c401bcc68dfe3be58081e2ae4 (patch)
tree0a7f8008c02492083e7bd22690c51d57d2688125
parent160334f3d94f0e3e1435a371c7b02f141d4c1bf1 (diff)
downloadandroid_external_f2fs-tools-f32207b10d6b7c2c401bcc68dfe3be58081e2ae4.tar.gz
android_external_f2fs-tools-f32207b10d6b7c2c401bcc68dfe3be58081e2ae4.tar.bz2
android_external_f2fs-tools-f32207b10d6b7c2c401bcc68dfe3be58081e2ae4.zip
fsck.f2fs: fix sit types seamlessly
SIT types can be wrong when active_logs are 2 or 4. So, let's fix this implicitly. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fsck/fsck.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 09bb26f..a5f9adc 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -1023,6 +1023,7 @@ int fsck_verify(struct f2fs_sb_info *sbi)
{
unsigned int i = 0;
int ret = 0;
+ int force = 0;
u32 nr_unref_nid = 0;
struct f2fs_fsck *fsck = F2FS_FSCK(sbi);
struct hard_link_node *node = NULL;
@@ -1129,14 +1130,9 @@ int fsck_verify(struct f2fs_sb_info *sbi)
config.bug_on = 1;
}
- printf("[FSCK] SIT types ");
- if (check_sit_types(sbi) == 0) {
- printf(" [Ok..]\n");
- } else {
- printf(" [Fail]\n");
- ret = EXIT_ERR_CODE;
- config.bug_on = 1;
- }
+ printf("[FSCK] fixing SIT types\n");
+ if (check_sit_types(sbi) != 0)
+ force = 1;
printf("[FSCK] other corrupted bugs ");
if (config.bug_on == 0) {
@@ -1147,7 +1143,7 @@ int fsck_verify(struct f2fs_sb_info *sbi)
}
/* fix global metadata */
- if (config.bug_on && config.fix_on) {
+ if (force || (config.bug_on && config.fix_on)) {
fix_nat_entries(sbi);
rewrite_sit_area_bitmap(sbi);
fix_checkpoint(sbi);