diff --git a/weed/storage/store.go b/weed/storage/store.go index 2d9ecbe32..64d424829 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -620,7 +620,8 @@ func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) { unusedSpace := diskLocation.UnUsedSpace(volumeSizeLimit) unclaimedSpaces := int64(diskStatus.Free) - int64(unusedSpace) volCount := diskLocation.VolumesLen() - maxVolumeCount := int32(volCount) + ecShardCount := diskLocation.EcShardCount() + maxVolumeCount := int32(volCount) + int32((ecShardCount+erasure_coding.DataShardsCount)/erasure_coding.DataShardsCount) if unclaimedSpaces > int64(volumeSizeLimit) { maxVolumeCount += int32(uint64(unclaimedSpaces)/volumeSizeLimit) - 1 }