]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Give a default reason in *sync-debug
authorAndrew Deason <adeason@sinenomine.net>
Wed, 2 Mar 2011 19:12:25 +0000 (13:12 -0600)
committerDerrick Brashear <shadow@dementia.org>
Thu, 3 Mar 2011 18:52:58 +0000 (10:52 -0800)
If no -reason is given for fssync-debug calls, we currently just
transmit garbage to the fileserver or salvageserver. Instead, give a
default (the *_WHATEVER constant), so we do something consistent.

Change-Id: I8fb134c8b16a1fca1b1ed804241d0b232e7e2a7c
Reviewed-on: http://gerrit.openafs.org/4115
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/tsalvaged/salvsync-debug.c
src/vol/fssync-debug.c

index b1c62eef833c8426175de8a41f5472ea33848121..3f64b7c58a7a80b309542a489bb8ebf7e1e5ab4d 100644 (file)
@@ -199,7 +199,10 @@ common_prolog(struct cmd_syndesc * as, struct state * state)
 
     if ((ti = as->parms[COMMON_PARMS_OFFSET].items)) { /* -reason */
        state->reason = atoi(ti->data);
+    } else {
+       state->reason = SALVSYNC_REASON_WHATEVER;
     }
+
     if ((ti = as->parms[COMMON_PARMS_OFFSET+1].items)) {       /* -programtype */
        if (!strcmp(ti->data, "fileServer")) {
            programType = fileServer;
index 9831883df775b791849e94fe8a299833eddd94db..e0fb64695f4eeff6929fb06e1a5156a29ad7844f 100644 (file)
@@ -333,7 +333,10 @@ common_prolog(struct cmd_syndesc * as, struct state * state)
 
     if ((ti = as->parms[COMMON_PARMS_OFFSET].items)) { /* -reason */
        state->reason = atoi(ti->data);
+    } else {
+       state->reason = FSYNC_WHATEVER;
     }
+
     if ((ti = as->parms[COMMON_PARMS_OFFSET+1].items)) {       /* -programtype */
        if (!strcmp(ti->data, "fileServer")) {
            programType = fileServer;
@@ -1493,8 +1496,6 @@ VGCDel(struct cmd_syndesc * as, void * rock)
     }
     child = atoi(ti->data);
 
-    state.reason = FSYNC_WHATEVER;
-
     common_prolog(as, &state);
     fprintf(stderr, "calling FSYNC_VCGDel\n");
     code = FSYNC_VGCDel(partName, parent, child, state.reason, &res);