From 712fdcff8953e115ba59e37b88e90dba770dc426 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Thu, 19 Nov 2015 20:46:07 +0000 Subject: [PATCH] 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 Upstream-commit: b9e701b203ff49966aac00e058feb5d46bbb97f0 Component: engine --- components/engine/daemon/container_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/engine/daemon/container_unix.go b/components/engine/daemon/container_unix.go index f4864b027a..d713bdb38c 100644 --- a/components/engine/daemon/container_unix.go +++ b/components/engine/daemon/container_unix.go @@ -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) } }