avoid divided by zero

This commit is contained in:
Chris Lu 2021-02-16 05:59:24 -08:00
parent a0c6db361c
commit ebf320ec22

View file

@ -471,6 +471,9 @@ func (s *Store) GetVolumeSizeLimit() uint64 {
func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) { func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) {
volumeSizeLimit := s.GetVolumeSizeLimit() volumeSizeLimit := s.GetVolumeSizeLimit()
if volumeSizeLimit == 0 {
return
}
for _, diskLocation := range s.Locations { for _, diskLocation := range s.Locations {
if diskLocation.OriginalMaxVolumeCount == 0 { if diskLocation.OriginalMaxVolumeCount == 0 {
currentMaxVolumeCount := diskLocation.MaxVolumeCount currentMaxVolumeCount := diskLocation.MaxVolumeCount