fsck.f2fs: add -y for generic fsck
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 28 Dec 2017 20:33:03 +0000 (12:33 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 3 Jan 2018 03:25:21 +0000 (19:25 -0800)
-y is same as -f, which fixes any corruption all the time.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/main.c

index db5c413..f35d01d 100644 (file)
@@ -57,6 +57,7 @@ void fsck_usage()
        MSG(0, "  -S sparse_mode\n");
        MSG(0, "  -t show directory tree\n");
        MSG(0, "  -q preserve quota limits\n");
+       MSG(0, "  -y fix all the time\n");
        MSG(0, "  --dry-run do not really fix corruptions\n");
        exit(1);
 }
@@ -159,7 +160,7 @@ void f2fs_parse_options(int argc, char *argv[])
        }
 
        if (!strcmp("fsck.f2fs", prog)) {
-               const char *option_string = ":ad:fp:q:St";
+               const char *option_string = ":ad:fp:q:Sty";
                int opt = 0;
                struct option long_opt[] = {
                        {"dry-run", no_argument, 0, 1},
@@ -213,6 +214,7 @@ void f2fs_parse_options(int argc, char *argv[])
                                MSG(0, "Info: Debug level = %d\n", c.dbg_lv);
                                break;
                        case 'f':
+                       case 'y':
                                c.fix_on = 1;
                                MSG(0, "Info: Force to fix corruption\n");
                                break;