salvager: alias -f to -force
authorAndrew Deason <adeason@sinenomine.net>
Mon, 8 Feb 2010 21:03:08 +0000 (15:03 -0600)
committerDerrick Brashear <shadow@dementia.org>
Tue, 9 Feb 2010 16:48:12 +0000 (08:48 -0800)
DAFS added the -forceDAFS flag, which made the '-f' flag ambiguous, when
it used to be short for '-force'. Restore the previous meaning of '-f'
to reduce backwards incompatibility.

FIXES 124916

Change-Id: Ieb864b35a91000960f9d9c503c28db56602df13e
Reviewed-on: http://gerrit.openafs.org/1254
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/vol/salvager.c

index 5f305c8..8716dc2 100644 (file)
@@ -198,7 +198,7 @@ handleit(struct cmd_syndesc *as, void *arock)
        Testing = 1;
     if (as->parms[4].items)    /* -inodes */
        ListInodeOption = 1;
-    if (as->parms[5].items)    /* -force */
+    if (as->parms[5].items || as->parms[20].items)     /* -force, -f */
        ForceSalvage = 1;
     if (as->parms[6].items)    /* -oktozap */
        OKToZap = 1;
@@ -503,6 +503,8 @@ main(int argc, char **argv)
     cmd_AddParm(ts, "-forceDAFS", CMD_FLAG, CMD_OPTIONAL,
                "For Demand Attach Fileserver, permit a manual volume salvage outside of the salvageserver");
 #endif /* FAST_RESTART */
+    cmd_Seek(ts, 20);
+    cmd_AddParm(ts, "-f", CMD_FLAG, CMD_OPTIONAL, "Alias for -force");
     err = cmd_Dispatch(argc, argv);
     Exit(err);
     return 0; /* not reached */