From 8a2d3fa036c34ec5dbd209f2ff3ea3b7ba23358d Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 1 Jun 2017 22:25:49 -0400 Subject: [PATCH] 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 Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk (cherry picked from commit cdb92f94598e5b25fbcdfc6fb1650218ec05d63f) Change-Id: I0ecf0bf52a78cd6e1de4e79fc4a33cb509a816f5 Reviewed-on: https://gerrit.openafs.org/12633 Tested-by: BuildBot Reviewed-by: Michael Meffie Tested-by: Michael Meffie Reviewed-by: Mark Vitale Reviewed-by: Stephan Wiesand --- src/vol/vol-salvage.c | 7 ++++++- src/vol/volume.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 53519dcc2a..bfe60edd04 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -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) { diff --git a/src/vol/volume.h b/src/vol/volume.h index f9ae8af947..ee46e3b310 100644 --- a/src/vol/volume.h +++ b/src/vol/volume.h @@ -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 */