Browse Source

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>
Vivek Goyal 9 years ago
parent
commit
b9e701b203
1 changed files with 2 additions and 2 deletions
  1. 2 2
      daemon/container_unix.go

+ 2 - 2
daemon/container_unix.go

@@ -1511,8 +1511,8 @@ func (container *Container) unmountVolumes(forceSyscall bool) error {
 
 
 	for _, volumeMount := range volumeMounts {
 	for _, volumeMount := range volumeMounts {
 		if forceSyscall {
 		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)
 			}
 			}
 		}
 		}