mirror of
https://github.com/containers/podman.git
synced 2025-10-17 03:04:21 +08:00
Remove locks from volumes
I was looking into why we have locks in volumes, and I'm fairly convinced they're unnecessary. We don't have a state whose accesses we need to guard with locks and syncs. The only real purpose for the lock was to prevent concurrent removal of the same volume. Looking at the code, concurrent removal ought to be fine with a bit of reordering - one or the other might fail, but we will successfully evict the volume from the state. Also, remove the 'prune' bool from RemoveVolume. None of our other API functions accept it, and it only served to toggle off more verbose error messages. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -421,7 +421,7 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool,
|
||||
|
||||
for _, v := range volumes {
|
||||
if volume, err := runtime.state.Volume(v); err == nil {
|
||||
if err := runtime.removeVolume(ctx, volume, false, true); err != nil && err != ErrNoSuchVolume && err != ErrVolumeBeingUsed {
|
||||
if err := runtime.removeVolume(ctx, volume, false); err != nil && err != ErrNoSuchVolume && err != ErrVolumeBeingUsed {
|
||||
logrus.Errorf("cleanup volume (%s): %v", v, err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user