]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix crash caused by dividing by 0 54155/head
authorjrchyang <yujrchyang@outlook.com>
Tue, 24 Oct 2023 02:03:09 +0000 (10:03 +0800)
committerjrchyang <yujrchyang@outlook.com>
Tue, 24 Oct 2023 02:13:23 +0000 (10:13 +0800)
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 <yuzhiqiang_yewu@cmss.chinamobile.com>
src/os/bluestore/BlueStore.cc

index ec03fcde14aeaf9af535acc23a29eb8e0bfac3ee..d031b2e4c010487090520302c5ceeae33fccec78 100644 (file)
@@ -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