volume: Don't unmount before deleting volume in copy

If we unmount first and then delete, the delete fails because the volume
was unmounted. Delete ends up doing the same thing as the unmount anyways.
This commit is contained in:
James Hartig
2020-09-01 22:00:00 -04:00
parent 2b14ae5819
commit 8e54e34576
3 changed files with 6 additions and 8 deletions

View File

@@ -174,6 +174,9 @@ func (l *DiskLocation) DeleteCollectionFromDiskLocation(collection string) (e er
}
func (l *DiskLocation) deleteVolumeById(vid needle.VolumeId) (found bool, e error) {
l.volumesLock.Lock()
defer l.volumesLock.Unlock()
v, ok := l.volumes[vid]
if !ok {
return