mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
DAFS: Allow FSSYNC salvages on unknown volumes
Allow salvage requests over FSSYNC (FORCE_ERROR with the FSYNC_SALVAGE reason code) that are requested on volumes that we do not know to exist. This can be helpful if a salvage is requested on a volume that someone attempted to create but failed, indicating that a partially-created volume may be in the way. Log an additional message when we do this, as it should not be a normal occurrence. Change-Id: I6e1bbe35111a41c489fe85cad36e6a8a6f323a5a Reviewed-on: http://gerrit.openafs.org/2285 Reviewed-by: Tom Keiser <tkeiser@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
ff072a08b5
commit
6b041b7cb0
@ -1268,6 +1268,22 @@ FSYNC_com_VolError(FSSYNC_VolOp_command * vcom, SYNC_response * res)
|
||||
}
|
||||
|
||||
vp = VLookupVolume_r(&error, vcom->vop->volume, NULL);
|
||||
|
||||
if (!vp && vcom->hdr->reason == FSYNC_SALVAGE) {
|
||||
/* The requested volume doesn't seem to exist. However, it is possible
|
||||
* that this is triggered by trying to create or clone a volume that
|
||||
* was prevented from succeeding by a half-created volume in the way.
|
||||
* (e.g. we tried to create volume X, but volume X exists except that
|
||||
* its .vol header was deleted for some reason) So, still try to
|
||||
* a salvage for that volume ID. */
|
||||
|
||||
Log("FSYNC_com_VolError: attempting to schedule salvage for unknown "
|
||||
"volume %lu part %s\n", afs_printable_uint32_lu(vcom->vop->volume),
|
||||
vcom->vop->partName);
|
||||
vp = VPreAttachVolumeById_r(&error, vcom->vop->partName,
|
||||
vcom->vop->volume);
|
||||
}
|
||||
|
||||
if (vp) {
|
||||
if (FSYNC_partMatch(vcom, vp, 0)) {
|
||||
/* null out salvsync control state, as it's no longer relevant */
|
||||
|
Loading…
Reference in New Issue
Block a user