Skip to content

Commit 4364ebd

Browse files
committed
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 <[email protected]>
1 parent c672d7a commit 4364ebd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/os/bluestore/BlueStore.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6890,7 +6890,7 @@ int BlueStore::_create_alloc()
68906890
cct, cct->_conf->bluestore_allocator,
68916891
bdev->get_conventional_region_size(),
68926892
alloc_size,
6893-
0, 0,
6893+
zone_size, 0,
68946894
"zoned_block");
68956895
if (!a) {
68966896
lderr(cct) << __func__ << " failed to create " << cct->_conf->bluestore_allocator

0 commit comments

Comments
 (0)