image: Unmount before removing device in error paths
The device remove fails unless we unmount first Upstream-commit: 41399ac005caa4de2dbb744e48f058f6a15e2d2b Component: engine
This commit is contained in:
committed by
Victor Vieux
parent
f35010d2a6
commit
9f649d336c
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user