From: Andrew Deason Date: Tue, 21 Feb 2012 23:46:41 +0000 (-0600) Subject: salvager: Do not require MaybeZapVolume fileName X-Git-Tag: upstream/1.6.6_pre2^2~87 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3648401e204a9d447766ff0999d747b24aebdc55;p=packages%2Fo%2Fopenafs.git salvager: Do not require MaybeZapVolume fileName In MaybeZapVolume, currently we do not remove the volume header if the given isp->volSummary->fileName is not set. This effectively means that we only actually "zap" volumes for which we have just created the header, or which are not referenced by any inodes. For readonly volumes that have errors, we want to delete the volumes instead of salvaging. Readonly volumes with valid headers will have fileName as NULL, though (set back in SalvageFileSys1), so MaybeZapVolume will refuse to remove them. What ends up happening is that the headers will stay around, but since we do not finish checking the volume, all of the inodes for the data in the volume will be dec'd. This results in a volume whose header exists, but none of its inodes (including special inodes) exist, so the volume will need to be salvaged again, and during that salvage will be deleted (because there are no inodes for the volume). Avoid all this, and just delete volume headers for volumes that lack a valid fileName. Instead try to avoid deleting headers with volSummary->deleted set, just so we don't try to delete the same headers twice. Related issue reported by Åsa Andersson. Reviewed-on: http://gerrit.openafs.org/6784 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit 839638870986ebd4cf992f7a2c81a23e37c14228) Change-Id: I0008d46d07c2ce763e70605b9260a7f71a86044a Reviewed-on: http://gerrit.openafs.org/9458 Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index e8a9e61f9..4bcdc6d28 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -4249,7 +4249,7 @@ MaybeZapVolume(struct SalvInfo *salvinfo, struct InodeSummary *isp, char *message, int deleteMe, int check) { if (readOnly(isp) || deleteMe) { - if (isp->volSummary && isp->volSummary->fileName) { + if (isp->volSummary && !isp->volSummary->deleted) { if (deleteMe) { if (!Showmode) Log("Volume %u (is only a partial volume--probably an attempt was made to move/restore it when a machine crash occured.\n", isp->volumeId);