diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-09-03 19:41:44 -0700 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2014-09-08 14:55:01 -0700 |
commit | 73b6e3eb4e944338edd80b4f27c29b7aa31c76f2 (patch) | |
tree | 7bf16c415de151c084569ca1538e421878237b45 /fsck/main.c | |
parent | de6c1c7ce25841547813c71ca3b6d067300f0530 (diff) | |
download | android_external_f2fs-tools-73b6e3eb4e944338edd80b4f27c29b7aa31c76f2.tar.gz android_external_f2fs-tools-73b6e3eb4e944338edd80b4f27c29b7aa31c76f2.tar.bz2 android_external_f2fs-tools-73b6e3eb4e944338edd80b4f27c29b7aa31c76f2.zip |
f2fs: rearrange options to remove redundant check
This patch summarizes the usage of options.
-a : auto_fix, fix corruption, only if f2fs reported some potential errors
-f : force, fix corruption entire partition
None : prompt, if fsck.f2fs detets any corruption
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fsck/main.c')
-rw-r--r-- | fsck/main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fsck/main.c b/fsck/main.c index e20eac2..2af3daf 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -17,7 +17,10 @@ void fsck_usage() { MSG(0, "\nUsage: fsck.f2fs [options] device\n"); MSG(0, "[options]:\n"); + MSG(0, " -a check/fix potential corruption, reported by f2fs\n"); MSG(0, " -d debug level [default:0]\n"); + MSG(0, " -f check/fix entire partition\n"); + MSG(0, " -t show directory tree [-d -1]\n"); exit(1); } @@ -214,24 +217,22 @@ fsck_again: f2fs_do_umount(sbi); out: if (config.func == FSCK && config.bug_on) { - if (config.fix_on == 0 && !config.auto_fix) { + if (config.fix_on == 0 && config.auto_fix == 0) { char ans[255] = {0}; retry: printf("Do you want to fix this partition? [Y/N] "); ret = scanf("%s", ans); ASSERT(ret >= 0); if (!strcasecmp(ans, "y")) - config.fix_cnt++; + config.fix_on = 1; else if (!strcasecmp(ans, "n")) - config.fix_cnt = 0; + config.fix_on = 0; else goto retry; - } else { - config.fix_cnt++; + + if (config.fix_on) + goto fsck_again; } - /* avoid infinite trials */ - if (config.fix_cnt > 0 && config.fix_cnt < 4) - goto fsck_again; } f2fs_finalize_device(&config); |