1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

Use lazy unmount to unmount volumes

Volumes can have more mount points beneath them and unmount will fail. This
is the case when a bind mounted directory on host already had a mount point
underneath it. So use lazy unmount instead.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: b9e701b203ff49966aac00e058feb5d46bbb97f0
Component: engine
This commit is contained in:
Vivek Goyal
2015-11-19 20:46:07 +00:00
committed by root
parent 3ac379c684
commit 712fdcff89

View File

@@ -1511,8 +1511,8 @@ func (container *Container) unmountVolumes(forceSyscall bool) error {
for _, volumeMount := range volumeMounts {
if forceSyscall {
if err := system.Unmount(volumeMount.Destination); err != nil {
logrus.Warnf("%s unmountVolumes: Failed to force umount %v", container.ID, err)
if err := detachMounted(volumeMount.Destination); err != nil {
logrus.Warnf("%s unmountVolumes: Failed to do lazy umount %v", container.ID, err)
}
}