]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix crash caused by dividing by 0 57197/head
authorjrchyang <yujrchyang@outlook.com>
Tue, 24 Oct 2023 02:03:09 +0000 (10:03 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Wed, 1 May 2024 10:32:20 +0000 (17:32 +0700)
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>
(cherry picked from commit 4364ebdfa4a218a61528f7579e45233cc4725326)

src/os/bluestore/BlueStore.cc

index 046f820b53367b323a34ec4bd9735a830a74d43a..0e9a65050a3d3e050ed3fb6a5ea04043e399599f 100644 (file)
@@ -5808,7 +5808,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