aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/disk_location.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/storage/disk_location.go')
-rw-r--r--weed/storage/disk_location.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go
index 0aedb0f47..234d1a5f4 100644
--- a/weed/storage/disk_location.go
+++ b/weed/storage/disk_location.go
@@ -114,17 +114,31 @@ func (l *DiskLocation) loadExistingVolumes(needleMapKind NeedleMapType) {
}
func (l *DiskLocation) DeleteCollectionFromDiskLocation(collection string) (e error) {
- l.Lock()
- defer l.Unlock()
+ l.Lock()
for k, v := range l.volumes {
if v.Collection == collection {
e = l.deleteVolumeById(k)
if e != nil {
+ l.Unlock()
+ return
+ }
+ }
+ }
+ l.Unlock()
+
+ l.ecVolumesLock.Lock()
+ for k, v := range l.ecVolumes {
+ if v.Collection == collection {
+ e = l.deleteEcVolumeById(k)
+ if e != nil {
+ l.ecVolumesLock.Unlock()
return
}
}
}
+ l.ecVolumesLock.Unlock()
+
return
}