fix unittest coredump due to block_size is 0

This commit is contained in:
caifeizhi
2023-04-27 16:18:45 +08:00
committed by ob-robot
parent 6b8425d8b0
commit 7e1a48d9dc

View File

@ -1298,7 +1298,7 @@ int64_t ObLocalDevice::get_reserved_block_count() const
int64_t ObLocalDevice::get_max_block_count(int64_t reserved_size) const int64_t ObLocalDevice::get_max_block_count(int64_t reserved_size) const
{ {
return get_max_block_size(reserved_size) / block_size_; return block_size_ > 0 ? get_max_block_size(reserved_size) / block_size_ : 0;
} }
int64_t ObLocalDevice::get_max_block_size(int64_t reserved_size) const int64_t ObLocalDevice::get_max_block_size(int64_t reserved_size) const