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>
This commit is contained in:
Vivek Goyal 2015-11-19 20:46:07 +00:00 committed by root
parent ec72163949
commit b9e701b203
1 changed files with 2 additions and 2 deletions

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)
}
}