]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
salvager: Do not set fileName on header fixup
authorAndrew Deason <adeason@sinenomine.net>
Tue, 21 Feb 2012 23:40:46 +0000 (17:40 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 11 Sep 2013 21:35:52 +0000 (14:35 -0700)
Currently, SalvageVolumeHeaderFile will set isp->volSummary->fileName
to a new string whenever the volume header needs to be created or
re-written. When control reaches back to SalvageFileSys1, this can
cause DeleteExtraVolumeHeaderFile to delete the header, since
vsp->fileName is used as a sort of indicator to see whether or not a
volume has been referenced by the inode summary.

When we create a new header, we avoid this because we allocate a new
VolumeSummary struct, which is not caught by the last
DeleteExtraVolumeHeaderFile for loop in SalvageFileSys1. However, we
do delete the header when we simply re-write a header, since we use
the existing VolumeSummary struct. Set fileName in neither, for
consistency.

Reviewed-on: http://gerrit.openafs.org/6783
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 76f12c2389fd2a8e09b4e869730169401d154ce9)

Change-Id: I4d59de02a190a6d175735482aa102a496407f32a
Reviewed-on: http://gerrit.openafs.org/9457
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/vol-salvage.c

index bfd18fb5f3f5eae796e331c0d50384a2839d5544..e8a9e61f90e11b4d5db97525867c5e793594ffac 100644 (file)
@@ -2346,7 +2346,6 @@ SalvageVolumeHeaderFile(struct SalvInfo *salvinfo, struct InodeSummary *isp,
                isp->volumeId, (Testing ? "it would have been " : ""),
                path);
        isp->volSummary = calloc(1, sizeof(struct VolumeSummary));
-       isp->volSummary->fileName = ToString(headerName);
 
        writefunc = VCreateVolumeDiskHeader;
     } else {
@@ -2364,7 +2363,6 @@ SalvageVolumeHeaderFile(struct SalvInfo *salvinfo, struct InodeSummary *isp,
                strcpy(headerName, isp->volSummary->fileName);
            } else {
                (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_printable_uint32_lu(isp->volumeId));
-               isp->volSummary->fileName = ToString(headerName);
            }
            (void)afs_snprintf(path, sizeof path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, headerName);