]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DAFS: Do not clear salv state on fssync salvage
authorAndrew Deason <adeason@sinenomine.net>
Fri, 1 Jul 2011 19:25:05 +0000 (14:25 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sat, 2 Jul 2011 03:17:37 +0000 (20:17 -0700)
When a volume is put into an error state via the FSYNC_VOL_FORCE_ERROR
command, we clear the salvage state informaton on it, since we're
forcing it offline and thus inaccessible. However, if we are forcing
it to an error state because the volume needs salvaging, we just
salvage it. In this case, do not clear the salvage state, since we
need to know if we've already requested or scheduled a salvage so we
can correctly keep track of the number of salvages performed.

Change-Id: Ic4efd7a78bfb1b99a5308f0c67e81f4779dfe545
Reviewed-on: http://gerrit.openafs.org/4900
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/fssync-server.c

index 0f3f70eb740602d2730bdee036f044b9463e21e9..3e356cb2dc7b415e1e87f86e49a2c0b198778de0 100644 (file)
@@ -1330,9 +1330,6 @@ FSYNC_com_VolError(FSSYNC_VolOp_command * vcom, SYNC_response * res)
 
     if (vp) {
        if (FSYNC_partMatch(vcom, vp, 0)) {
-           /* null out salvsync control state, as it's no longer relevant */
-           memset(&vp->salvage, 0, sizeof(vp->salvage));
-
            VCreateReservation_r(vp);
            VWaitExclusiveState_r(vp);
             VDeregisterVolOp_r(vp);
@@ -1340,6 +1337,8 @@ FSYNC_com_VolError(FSSYNC_VolOp_command * vcom, SYNC_response * res)
             if (vcom->hdr->reason == FSYNC_SALVAGE) {
                FSYNC_backgroundSalvage(vp);
             } else {
+               /* null out salvsync control state, as it's no longer relevant */
+               memset(&vp->salvage, 0, sizeof(vp->salvage));
                VChangeState_r(vp, VOL_STATE_ERROR);
             }