Repository navigation
pool: a volume run no longer checks that it is the registered run - #686
Merged
Merged
Conversation
m.volumeRuns has one insert and one delete, both by the run's owner, and every function that takes the run runs inside that owner, so the check could not fire. A replaced or released record is still refused by heldErrLocked and holdsLocked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A cut, no behaviour change: a volume change (and the remount after a guest reboot) no longer checks that its run is the one registered for the claim.
checkVolumeRunLocked: them.volumeRuns[sb] != runcase is gone, and with it therunparameter ofcheckVolumeRunLocked,checkVolumeRunanddetachVolumeRun.commitVolumeRun: the same comparison is gone.ownsRunLockedis deleted; its three callers (settleReboot,recordVolumeError,clearVolumeError) callholdsLockedand the two error functions lose theirrunparameter.sandboxd/pool/CHECKLIST.md: thesettleRebootrow namesholdsLocked.Production lines: +25 -34 in
volume_mutation.goandreboot.go, net -9. Tests: two call sites drop the argument; no assertion changes.Why it could not fire
m.volumeRunsis made once and never reassigned. It has one insert, inbeginVolumeRun, underm.mu, only when the claim has no entry and after the caller waited out the active run; and one delete, infinishVolumeRun, in the samem.muhold that closes the run'sdone.finishVolumeRunis called only by the run's owner, in a defer set after a successful begin (changeVolumes,settleReboot).cancelVolumeRun, the one outside reader, cancels the run and copies its holds; it does not write the map.heldErrLocked(ErrReplaced), which ran before the deleted comparison in both functions.So the entry under the caller's own record was always the caller's run, and a released or replaced record is refused by
heldErrLockedandholdsLockedas before.Evidence
go test -race ./pool/ ./server/passed with no panic.m.volumeRunsor expectsErrUnknownSandboxfrom a run mismatch.golangci-lint0 issues in all five modules on linux and darwin,aslclean,go test -race ./...green on darwin and in a linux container; Go comment lines +0 -0.Hot path
None of these functions is on the claim path: they run on a volume change and on the remount after a guest reboot.
Not run on hardware: nothing reachable changes.