From: Jeffrey Altman Date: Fri, 2 Jun 2017 02:25:49 +0000 (-0400) Subject: vol: modify volume updateDate upon salvage change X-Git-Tag: BP-openafs-stable-1_8_x~32 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=cdb92f94598e5b25fbcdfc6fb1650218ec05d63f 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. Change-Id: I9a35b92e8abbe3b54b08e64ac13de44442736c72 Reviewed-on: https://gerrit.openafs.org/12629 Tested-by: BuildBot Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk --- diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 87e265d..acde64b 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -4305,7 +4305,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 bdbf084..e600237 100644 --- a/src/vol/volume.h +++ b/src/vol/volume.h @@ -451,7 +451,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 */