From 8388c2e10b424c77dc4b32db0865bd82f540dc62 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 2 Nov 2015 14:40:29 -0800 Subject: [PATCH] Do not ignore error from syscall.Unmount Signed-off-by: Alexander Morozov Upstream-commit: 3f10bdf100067580c35e27524b10ad06fadd0527 Component: engine --- components/engine/daemon/container.go | 4 +++- components/engine/pkg/system/syscall_unix.go | 4 ++-- components/engine/pkg/system/syscall_windows.go | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/engine/daemon/container.go b/components/engine/daemon/container.go index f6250d37d9..8938ae41a4 100644 --- a/components/engine/daemon/container.go +++ b/components/engine/daemon/container.go @@ -1168,7 +1168,9 @@ func (container *Container) unmountVolumes(forceSyscall bool) error { for _, volumeMount := range volumeMounts { if forceSyscall { - system.Unmount(volumeMount.Destination) + if err := system.Unmount(volumeMount.Destination); err != nil { + logrus.Warnf("%s unmountVolumes: Failed to force umount %v", container.ID, err) + } } if volumeMount.Volume != nil { diff --git a/components/engine/pkg/system/syscall_unix.go b/components/engine/pkg/system/syscall_unix.go index 50054765af..f1497c587e 100644 --- a/components/engine/pkg/system/syscall_unix.go +++ b/components/engine/pkg/system/syscall_unix.go @@ -6,6 +6,6 @@ import "syscall" // Unmount is a platform-specific helper function to call // the unmount syscall. -func Unmount(dest string) { - syscall.Unmount(dest, 0) +func Unmount(dest string) error { + return syscall.Unmount(dest, 0) } diff --git a/components/engine/pkg/system/syscall_windows.go b/components/engine/pkg/system/syscall_windows.go index 3a3a55b266..b3b94cb5eb 100644 --- a/components/engine/pkg/system/syscall_windows.go +++ b/components/engine/pkg/system/syscall_windows.go @@ -2,5 +2,6 @@ package system // Unmount is a platform-specific helper function to call // the unmount syscall. Not supported on Windows -func Unmount(dest string) { +func Unmount(dest string) error { + return nil }