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

Merge pull request #4499 from alexlarsson/fix-remove-fail

DeviceMapper: Succeed immediately when removing non-existant devices
This commit is contained in:
Guillaume J. Charmes 2014-03-11 10:09:58 -07:00
commit af3ff044a2

View file

@ -90,6 +90,13 @@ func (d *Driver) Create(id, parent string) error {
}
func (d *Driver) Remove(id string) error {
if !d.DeviceSet.HasDevice(id) {
// Consider removing a non-existing device a no-op
// This is useful to be able to progress on container removal
// if the underlying device has gone away due to earlier errors
return nil
}
// Sink the float from create in case no Get() call was made
if err := d.DeviceSet.UnmountDevice(id, UnmountSink); err != nil {
return err