From 01cbd5cb589f27ba4ffc5db3ca868c91f0d2c8a9 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 8 Sep 2016 09:50:27 -0700 Subject: [PATCH] lock fix https://github.com/chrislusf/seaweedfs/issues/367 --- weed/storage/compact_map.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/storage/compact_map.go b/weed/storage/compact_map.go index 6afaf7df8..721be2ec7 100644 --- a/weed/storage/compact_map.go +++ b/weed/storage/compact_map.go @@ -41,10 +41,10 @@ func NewCompactSection(start Key) *CompactSection { //return old entry size func (cs *CompactSection) Set(key Key, offset uint32, size uint32) uint32 { ret := uint32(0) + cs.Lock() if key > cs.end { cs.end = key } - cs.Lock() if i := cs.binarySearchValues(key); i >= 0 { ret = cs.values[i].Size //println("key", key, "old size", ret)