From 9f649d336c5b248ed42f1f8ea8cf8d7266274108 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 19 Sep 2013 19:22:23 +0200 Subject: [PATCH] image: Unmount before removing device in error paths The device remove fails unless we unmount first Upstream-commit: 41399ac005caa4de2dbb744e48f058f6a15e2d2b Component: engine --- components/engine/image.go | 1 + 1 file changed, 1 insertion(+) diff --git a/components/engine/image.go b/components/engine/image.go index 16abf9eef0..f495e8e8fc 100644 --- a/components/engine/image.go +++ b/components/engine/image.go @@ -421,6 +421,7 @@ func (image *Image) ensureImageDevice(devices DeviceSet) error { err = image.applyLayer(layerPath(root), mountDir) if err != nil { + _ = devices.UnmountDevice(image.ID, mountDir) _ = devices.RemoveDevice(image.ID) return err }