]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: modify volume updateDate upon salvage change
authorJeffrey Altman <jaltman@auristor.com>
Fri, 2 Jun 2017 02:25:49 +0000 (22:25 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 5 Jun 2017 01:24:26 +0000 (21:24 -0400)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/vol/vol-salvage.c
src/vol/volume.h

index 87e265d3b6b406feb5a83da1fcefebd203385ede..acde64b88b0bd53dd683d9d682b8b91362b697af 100644 (file)
@@ -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) {
index bdbf084facd714e25ff5aa6456a04e21c399b2ac..e600237b3fa0d4f9274a7f354c99834677a8885b 100644 (file)
@@ -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 */