diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-16 05:59:24 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-16 05:59:24 -0800 |
| commit | ebf320ec2260f86558693f4bd8876df3bc6fb094 (patch) | |
| tree | 8fbda8e51ef5f558de09d73835a5b7a58b64be01 | |
| parent | a0c6db361c7f37f88c58c61b253e2f8cb28d582b (diff) | |
| download | seaweedfs-ebf320ec2260f86558693f4bd8876df3bc6fb094.tar.xz seaweedfs-ebf320ec2260f86558693f4bd8876df3bc6fb094.zip | |
avoid divided by zero
| -rw-r--r-- | weed/storage/store.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/storage/store.go b/weed/storage/store.go index a18d87a77..92f1db2bc 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -471,6 +471,9 @@ func (s *Store) GetVolumeSizeLimit() uint64 { func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) { volumeSizeLimit := s.GetVolumeSizeLimit() + if volumeSizeLimit == 0 { + return + } for _, diskLocation := range s.Locations { if diskLocation.OriginalMaxVolumeCount == 0 { currentMaxVolumeCount := diskLocation.MaxVolumeCount |
