diff options
-rw-r--r-- | src/crimson/os/seastore/random_block_manager/block_rb_manager.cc | 2 | ||||
-rw-r--r-- | src/test/crimson/seastore/test_randomblock_manager.cc | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/crimson/os/seastore/random_block_manager/block_rb_manager.cc b/src/crimson/os/seastore/random_block_manager/block_rb_manager.cc index 81a836a7c3e..9f6a566d15c 100644 --- a/src/crimson/os/seastore/random_block_manager/block_rb_manager.cc +++ b/src/crimson/os/seastore/random_block_manager/block_rb_manager.cc @@ -132,6 +132,7 @@ BlockRBManager::write_ertr::future<> BlockRBManager::write( bufferptr bptr) { ceph_assert(device); + ceph_assert(bptr.is_page_aligned()); rbm_abs_addr addr = convert_paddr_to_abs_addr(paddr); if (!check_valid_range(addr, bptr)) { return crimson::ct_error::erange::make(); @@ -146,6 +147,7 @@ BlockRBManager::read_ertr::future<> BlockRBManager::read( bufferptr &bptr) { ceph_assert(device); + ceph_assert(bptr.is_page_aligned()); rbm_abs_addr addr = convert_paddr_to_abs_addr(paddr); if (!check_valid_range(addr, bptr)) { return crimson::ct_error::erange::make(); diff --git a/src/test/crimson/seastore/test_randomblock_manager.cc b/src/test/crimson/seastore/test_randomblock_manager.cc index 26205e16487..82dc63ce263 100644 --- a/src/test/crimson/seastore/test_randomblock_manager.cc +++ b/src/test/crimson/seastore/test_randomblock_manager.cc @@ -107,7 +107,9 @@ struct rbm_test_t : std::numeric_limits<char>::max() ); char contents = distribution(generator); - return buffer::ptr(buffer::create(blocks * block_size, contents)); + auto bp = bufferptr(ceph::buffer::create_page_aligned(blocks * block_size)); + memset(bp.c_str(), contents, bp.length()); + return bp; } void close() { |