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>
This commit is contained in:
parent
55fcd6f4db
commit
6e25bb2ed6
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue