diff options
author | Matthew Heon <mheon@redhat.com> | 2021-02-10 09:46:12 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-02-11 13:27:12 -0500 |
commit | 9de1a68fff2ea6353823365ad860827a5af4aa99 (patch) | |
tree | e931cba0320ae9b71b8d731061d9a887469b93d9 /libpod/volume.go | |
parent | bb82839492b5226c8c5b04906a05da311177f713 (diff) | |
download | podman-9de1a68fff2ea6353823365ad860827a5af4aa99.tar.gz podman-9de1a68fff2ea6353823365ad860827a5af4aa99.tar.bz2 podman-9de1a68fff2ea6353823365ad860827a5af4aa99.zip |
Rewrite copy-up to use buildah Copier
The old copy-up implementation was very unhappy with symlinks,
which could cause containers to fail to start for unclear reasons
when a directory we wanted to copy-up contained one. Rewrite to
use the Buildah Copier, which is more recent and should be both
safer and less likely to blow up over links.
At the same time, fix a deadlock in copy-up for volumes requiring
mounting - the Mountpoint() function tried to take the
already-acquired volume lock.
Fixes #6003
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/volume.go')
-rw-r--r-- | libpod/volume.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libpod/volume.go b/libpod/volume.go index 4c137cb8e..5cc5e7e40 100644 --- a/libpod/volume.go +++ b/libpod/volume.go @@ -130,11 +130,18 @@ func (v *Volume) MountPoint() (string, error) { if err := v.update(); err != nil { return "", err } + } + + return v.mountPoint(), nil +} - return v.state.MountPoint, nil +// Internal-only helper for volume mountpoint +func (v *Volume) mountPoint() string { + if v.UsesVolumeDriver() { + return v.state.MountPoint } - return v.config.MountPoint, nil + return v.config.MountPoint } // Options return the volume's options |