diff --git a/weed/storage/needle_map_metric.go b/weed/storage/needle_map_metric.go index 0ce616131..abf6b4b8b 100644 --- a/weed/storage/needle_map_metric.go +++ b/weed/storage/needle_map_metric.go @@ -105,9 +105,8 @@ func newNeedleMapMetricFromIndexFile(r *os.File) (mm *mapMetric, err error) { mm.FileByteCounter += uint64(size) } - if !bf.TestAndAdd(buf) { - mm.FileCounter++ - } else { + mm.FileCounter++ + if bf.TestAndAdd(buf) { // deleted file mm.DeletionCounter++ if size.IsValid() {