mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
crimson/os/seastore/.../block.cc: add error message on alloc error to segment_write
Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
47d8167cc4
commit
24267ea8cb
@ -239,15 +239,27 @@ Segment::write_ertr::future<> BlockSegmentManager::segment_write(
|
||||
get_offset(addr),
|
||||
bl.length());
|
||||
|
||||
bufferptr bptr;
|
||||
try {
|
||||
bptr = bufferptr(ceph::buffer::create_page_aligned(bl.length()));
|
||||
auto iter = bl.cbegin();
|
||||
iter.copy(bl.length(), bptr.c_str());
|
||||
} catch (const std::exception &e) {
|
||||
logger().error(
|
||||
"BlockSegmentManager::segment_write: "
|
||||
"exception creating aligned buffer {}",
|
||||
e
|
||||
);
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
// TODO send an iovec and avoid the copy -- bl should have aligned
|
||||
// constituent buffers and they will remain unmodified until the write
|
||||
// completes
|
||||
return seastar::do_with(
|
||||
bufferptr(ceph::buffer::create_page_aligned(bl.length())),
|
||||
std::move(bptr),
|
||||
[&](auto &bp) {
|
||||
auto iter = bl.cbegin();
|
||||
iter.copy(bl.length(), bp.c_str());
|
||||
return do_write(device, get_offset(addr), bp);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user