From 5be77901cd505aad002b912b5febe2ba6baa23fd Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Wed, 3 Dec 2014 13:06:43 -0500 Subject: [PATCH] devmapper: Do not add back device into hash map if meta file removal failed When we are deleting a device, we also delete associated metadata file. If that file removal fails, we are adding back the device in in-memory table. I really can't see what's the point. When next lookup takes place it will be automatically loaded if need be. Remove that code. Signed-off-by: Vivek Goyal --- daemon/graphdriver/devmapper/deviceset.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/daemon/graphdriver/devmapper/deviceset.go b/daemon/graphdriver/devmapper/deviceset.go index 26a3da8cf..b4ce1b3b5 100644 --- a/daemon/graphdriver/devmapper/deviceset.go +++ b/daemon/graphdriver/devmapper/deviceset.go @@ -814,9 +814,6 @@ func (devices *DeviceSet) deleteDevice(info *DevInfo) error { devices.devicesLock.Unlock() if err := devices.removeMetadata(info); err != nil { - devices.devicesLock.Lock() - devices.Devices[info.Hash] = info - devices.devicesLock.Unlock() log.Debugf("Error removing meta data: %s", err) return err }