diff --git a/head.go b/head.go index 704c0b222b..dd441f7973 100644 --- a/head.go +++ b/head.go @@ -260,9 +260,12 @@ Outer: return err } + // Map is accessed in other places also, so protect it. + h.mtx.Lock() for k, v := range newStones { h.tombstones[k] = h.tombstones[k].add(v[0]) } + h.mtx.Unlock() h.meta.NumTombstones = int64(len(h.tombstones)) return nil