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>
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);
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);
}