devmapper: Implement deferred deletion functionality
Finally here is the patch to implement deferred deletion functionality. Deferred deleted devices are marked as "Deleted" in device meta file. First we try to delete the device and only if deletion fails and user has enabled deferred deletion, device is marked for deferred deletion. When docker starts up again, we go through list of deleted devices and try to delete these again. Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
4ebc358c68
commit
30047b6365
1 changed files with 4 additions and 0 deletions
|
@ -750,7 +750,11 @@ func DeleteDevice(poolName string, deviceID int) error {
|
|||
return fmt.Errorf("Can't set message %s", err)
|
||||
}
|
||||
|
||||
dmSawBusy = false
|
||||
if err := task.run(); err != nil {
|
||||
if dmSawBusy {
|
||||
return ErrBusy
|
||||
}
|
||||
return fmt.Errorf("Error running DeleteDevice %s", err)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue