vol: modify volume updateDate upon salvage change

If the salvager changed the volume, set the VolumeDiskData.updateDate
field so that

  1. the change is visible via "vos examine"

  2. backup services will backup the corrected volume

Teradactyl pointed out the problem which forces cell administrators
to manually trigger a backup for each volume that has been salvaged.

Reviewed-on: https://gerrit.openafs.org/12629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit cdb92f94598e5b25fbcdfc6fb1650218ec05d63f)

Change-Id: I0ecf0bf52a78cd6e1de4e79fc4a33cb509a816f5
Reviewed-on: https://gerrit.openafs.org/12633
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
Jeffrey Altman 2017-06-01 22:25:49 -04:00 committed by Stephan Wiesand
parent 7d5473963f
commit 8a2d3fa036
2 changed files with 7 additions and 2 deletions

View File

@ -4330,7 +4330,12 @@ SalvageVolume(struct SalvInfo *salvinfo, struct InodeSummary *rwIsp, IHandle_t *
volHeader.inUse = 0; /* clear flag indicating inUse@last crash */
volHeader.needsSalvaged = 0; /* clear 'damaged' flag */
volHeader.inService = 1; /* allow service again */
volHeader.needsCallback = (salvinfo->VolumeChanged != 0);
if (salvinfo->VolumeChanged) {
volHeader.needsCallback = 1;
volHeader.updateDate = time(NULL);
} else {
volHeader.needsCallback = 0;
}
volHeader.dontSalvage = DONT_SALVAGE;
salvinfo->VolumeChanged = 0;
if (!Testing) {

View File

@ -457,7 +457,7 @@ typedef struct VolumeDiskData {
* a readonly volume (replicated volumes have
* the same creation date) */
Date accessDate; /* Last access time by a user, large granularity */
Date updateDate; /* Last modification by user */
Date updateDate; /* Last modification by user or salvager */
Date expirationDate; /* 0 if it never expires */
Date backupDate; /* last time a backup clone was taken */