diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index 5e48056f7..715b5ed80 100644 --- a/weed/topology/data_node.go +++ b/weed/topology/data_node.go @@ -135,12 +135,12 @@ func (dn *DataNode) DeltaUpdateVolumes(newVolumes, deletedVolumes []storage.Volu } func (dn *DataNode) AdjustMaxVolumeCounts(maxVolumeCounts map[string]uint32) { - deltaDiskUsages := newDiskUsages() for diskType, maxVolumeCount := range maxVolumeCounts { if maxVolumeCount == 0 { // the volume server may have set the max to zero continue } + deltaDiskUsages := newDiskUsages() dt := types.ToDiskType(diskType) currentDiskUsage := dn.diskUsages.getOrCreateDisk(dt) currentDiskUsageMaxVolumeCount := atomic.LoadInt64(¤tDiskUsage.maxVolumeCount)