image: Unmount before removing device in error paths

The device remove fails unless we unmount first
Upstream-commit: 6f57e8025a0a03da8052edc30157f7677f65f208
Component: engine
This commit is contained in:
Alexander Larsson
2013-09-19 19:22:23 +02:00
committed by Tianon Gravi
parent 5fc36fa5bf
commit 890bafe58d

View File

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