From: jrchyang Date: Tue, 24 Oct 2023 02:03:09 +0000 (+0800) Subject: os/bluestore: fix crash caused by dividing by 0 X-Git-Tag: v19.0.0~243^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F54155%2Fhead;p=ceph.git os/bluestore: fix crash caused by dividing by 0 In Allocator::create() => ZonedAllocator::ZonedAllocator() num_zones is calculated by size / zone_size, causing a crash when zone_size is set to 0 Signed-off-by: Jrchyang Yu --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index ec03fcde14ae..d031b2e4c010 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6890,7 +6890,7 @@ int BlueStore::_create_alloc() cct, cct->_conf->bluestore_allocator, bdev->get_conventional_region_size(), alloc_size, - 0, 0, + zone_size, 0, "zoned_block"); if (!a) { lderr(cct) << __func__ << " failed to create " << cct->_conf->bluestore_allocator