summaryrefslogtreecommitdiff
path: root/libpod/runtime_renumber.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-28 11:25:12 -0700
committerGitHub <noreply@github.com>2019-08-28 11:25:12 -0700
commitbdf9e568134c37f02f662080cfe32f7ca98710c9 (patch)
treec310ec1ca3d1cdb3db69c2972fa8e2322a4badbe /libpod/runtime_renumber.go
parentced3ebb512e1b578184317e9ff6474f892d1c382 (diff)
parente563f4111600a6c5506e4953bf796783a097544f (diff)
downloadpodman-bdf9e568134c37f02f662080cfe32f7ca98710c9.tar.gz
podman-bdf9e568134c37f02f662080cfe32f7ca98710c9.tar.bz2
podman-bdf9e568134c37f02f662080cfe32f7ca98710c9.zip
Merge pull request #3893 from mheon/readd_volume_locks
Re-add volume locks
Diffstat (limited to 'libpod/runtime_renumber.go')
-rw-r--r--libpod/runtime_renumber.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/libpod/runtime_renumber.go b/libpod/runtime_renumber.go
index 735ffba34..9de2556b2 100644
--- a/libpod/runtime_renumber.go
+++ b/libpod/runtime_renumber.go
@@ -53,6 +53,23 @@ func (r *Runtime) renumberLocks() error {
return err
}
}
+ allVols, err := r.state.AllVolumes()
+ if err != nil {
+ return err
+ }
+ for _, vol := range allVols {
+ lock, err := r.lockManager.AllocateLock()
+ if err != nil {
+ return errors.Wrapf(err, "error allocating lock for volume %s", vol.Name())
+ }
+
+ vol.config.LockID = lock.ID()
+
+ // Write the new lock ID
+ if err := r.state.RewriteVolumeConfig(vol, vol.config); err != nil {
+ return err
+ }
+ }
r.newSystemEvent(events.Renumber)