From 02a159764262dcaf7234ac1d88af1fdb408edd0d Mon Sep 17 00:00:00 2001 From: liwenlong05 Date: Thu, 3 May 2018 11:20:38 +0800 Subject: [PATCH 1/2] fix leveldb mount bug --- weed/storage/disk_location.go | 1 + 1 file changed, 1 insertion(+) diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go index 99c4f3c34..c656da4ca 100644 --- a/weed/storage/disk_location.go +++ b/weed/storage/disk_location.go @@ -168,6 +168,7 @@ func (l *DiskLocation) UnloadVolume(vid VolumeId) error { if !ok { return fmt.Errorf("Volume not loaded, VolumeId: %d", vid) } + l.volumes[vid].Close() delete(l.volumes, vid) return nil } From b9068c13040918091fd5e4ad978be3ca227b8a29 Mon Sep 17 00:00:00 2001 From: WenLong LI <13273887167@163.com> Date: Thu, 3 May 2018 12:13:53 +0800 Subject: [PATCH 2/2] use volumes variable fix leveldb mount bug --- weed/storage/disk_location.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go index c656da4ca..9589d9281 100644 --- a/weed/storage/disk_location.go +++ b/weed/storage/disk_location.go @@ -164,11 +164,11 @@ func (l *DiskLocation) UnloadVolume(vid VolumeId) error { l.Lock() defer l.Unlock() - _, ok := l.volumes[vid] + v, ok := l.volumes[vid] if !ok { return fmt.Errorf("Volume not loaded, VolumeId: %d", vid) } - l.volumes[vid].Close() + v.Close() delete(l.volumes, vid) return nil }