mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
devicemapper: fix suspend removed device
when doing devices.cancelDeferredRemoval, the device could have been removed and return ErrEnxio, but it continue to check if it is need to do suspend. doSuspend := devinfo != nil && devinfo.Exists != 0 uses a devinfo which is get before devices.cancelDeferredRemoval(baseInfo), it is outdate, the device has been removed and there is no need to do suspend. If do suspend it will return devicemapper: Error running deviceSuspend dm_task_run failed. Signed-off-by: Lei Jitang <leijitang@huawei.com> Upstream-commit: 6e25bb2ed6560baec4b13930e673c88f1b49de34 Component: engine
This commit is contained in:
@@ -858,6 +858,7 @@ func (devices *DeviceSet) takeSnapshot(hash string, baseInfo *devInfo, size uint
|
||||
if err != devicemapper.ErrEnxio {
|
||||
return err
|
||||
}
|
||||
devinfo = nil
|
||||
} else {
|
||||
defer devices.deactivateDevice(baseInfo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user