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 }