From 903b5847cc017b7164542990dca022f6c41c4ed2 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 23 Feb 2012 13:02:13 -0600 Subject: [PATCH] salvager: Do not fork for single VG salvage Currently we always fork a child in the salvager in order to salvage a volume group. I believe this is in order to protect SEGV, exit(), etc in one salvage operation from preventing salvaging anything else. When salvaging a single volume group, though, there appears to be little benefit. In addition, we need to keep the VG salvaging code in the same process as the cleanup code for single-volume salvages, so we can know which volumes were deleted by SalvageVolumeGroup, so we know which volumes to bring back online. So, do not fork for the singleVolumeNumber case. Note that for DAFS, we already never fork for the entire salvage operation when salvaging an individual volume group. So, this is effectively a non-DAFS-only change. Reviewed-on: http://gerrit.openafs.org/6787 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit 46e85dd4682a3273e15bbf96c4d5492087555cab) Change-Id: I545e9ad8d54ad63dbe8e221dfc6947446135cbb7 Reviewed-on: http://gerrit.openafs.org/9462 Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/vol/vol-salvage.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 91e5cb123..fb8859b27 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -906,6 +906,16 @@ SalvageFileSys1(struct DiskPartition64 *partP, VolumeId singleVolumeNumber) goto retry; } + if (singleVolumeNumber) { + /* If we delete a volume during the salvage, we indicate as such by + * setting the volsummary->deleted field. We need to know if we + * deleted a volume or not in order to know which volumes to bring + * back online after the salvage. If we fork, we will lose this + * information, since volsummary->deleted will not get set in the + * parent. So, don't fork. */ + canfork = 0; + } + for (i = j = 0, vsp = salvinfo->volumeSummaryp, esp = vsp + salvinfo->nVolumes; i < salvinfo->nVolumesInInodeFile; i = j) { VolumeId rwvid = salvinfo->inodeSummary[i].RWvolumeId; -- 2.39.5