1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

image: Unmount before removing device in error paths

The device remove fails unless we unmount first
This commit is contained in:
Alexander Larsson 2013-09-19 19:22:23 +02:00 committed by Victor Vieux
parent 67788723c9
commit 41399ac005

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
}