enoent,
invarg,
enodata,
- input_output_error
+ input_output_error,
+ object_corrupted
};
}
using enodata = unthrowable_wrapper<_impl::ct_error::enodata>;
using invarg = unthrowable_wrapper<_impl::ct_error::invarg>;
using input_output_error = unthrowable_wrapper<_impl::ct_error::input_output_error>;
+ using object_corrupted = unthrowable_wrapper<_impl::ct_error::object_corrupted>;
}
} // namespace crimson
osd_op.op.extent.length,
osd_op.op.extent.truncate_size,
osd_op.op.extent.truncate_seq,
- osd_op.op.flags).then(
+ osd_op.op.flags).safe_then(
[&osd_op](bufferlist bl) {
osd_op.rval = bl.length();
osd_op.outdata = std::move(bl);
return seastar::now();
- });
+ }, PGBackend::read_errorator::discard_all{});
});
case CEPH_OSD_OP_GETXATTR:
return do_read_op([&osd_op] (auto& backend, const auto& os) {
return true;
}
-seastar::future<bufferlist> PGBackend::read(const object_info_t& oi,
- size_t offset,
- size_t length,
- size_t truncate_size,
- uint32_t truncate_seq,
- uint32_t flags)
+PGBackend::read_errorator::future<ceph::bufferlist>
+PGBackend::read(const object_info_t& oi,
+ const size_t offset,
+ size_t length,
+ const size_t truncate_size,
+ const uint32_t truncate_seq,
+ const uint32_t flags)
{
logger().trace("read: {} {}~{}", oi.soid, offset, length);
// are we beyond truncate_size?
return seastar::make_ready_future<bufferlist>();
}
return _read(oi.soid, offset, length, flags).safe_then(
- [&oi](auto&& bl) {
+ [&oi](auto&& bl) -> read_errorator::future<ceph::bufferlist> {
if (const bool is_fine = _read_verify_data(oi, bl); is_fine) {
return seastar::make_ready_future<bufferlist>(std::move(bl));
} else {
- throw crimson::osd::object_corrupted{};
+ return crimson::make_error<ceph::ct_error::object_corrupted>();
}
- }, ll_read_errorator::throw_as_runtime_error{});
+ }, ll_read_errorator::pass_further{});
}
seastar::future<> PGBackend::stat(
seastar::future<cached_os_t> get_object_state(const hobject_t& oid);
seastar::future<> evict_object_state(const hobject_t& oid);
- using read_errorator = \
- ll_read_errorator::extend<crimson::ct_error::input_output_error>;
- seastar::future<bufferlist> read(const object_info_t& oi,
- uint64_t off,
- uint64_t len,
- size_t truncate_size,
- uint32_t truncate_seq,
- uint32_t flags);
+ using read_errorator = ll_read_errorator::extend<
+ crimson::ct_error::input_output_error,
+ crimson::ct_error::object_corrupted>;
+ read_errorator::future<ceph::bufferlist> read(
+ const object_info_t& oi,
+ uint64_t off,
+ uint64_t len,
+ size_t truncate_size,
+ uint32_t truncate_seq,
+ uint32_t flags);
seastar::future<> stat(
const ObjectState& os,
OSDOp& osd_op);