crimson::ct_error::permission_denied,
crimson::ct_error::operation_not_supported,
crimson::ct_error::input_output_error,
- crimson::ct_error::value_too_large>;
+ crimson::ct_error::value_too_large,
+ crimson::ct_error::file_too_large>;
using read_errorator = PGBackend::read_errorator;
using write_ertr = PGBackend::write_ertr;
using get_attr_errorator = PGBackend::get_attr_errorator;
}
}
-PGBackend::interruptible_future<> PGBackend::write(
+PGBackend::write_iertr::future<> PGBackend::write(
ObjectState& os,
const OSDOp& osd_op,
ceph::os::Transaction& txn,
uint64_t offset = op.extent.offset;
uint64_t length = op.extent.length;
bufferlist buf = osd_op.indata;
+ if (op.extent.length != osd_op.indata.length()) {
+ return crimson::ct_error::invarg::make();
+ }
+
+ if (!is_offset_and_length_valid(op.extent.offset, op.extent.length)) {
+ return crimson::ct_error::file_too_large::make();
+ }
+
if (auto seq = os.oi.truncate_seq;
seq != 0 && op.extent.truncate_seq < seq) {
// old write, arrived after trimtrunc
return seastar::now();
}
-PGBackend::interruptible_future<> PGBackend::writefull(
+PGBackend::write_iertr::future<> PGBackend::writefull(
ObjectState& os,
const OSDOp& osd_op,
ceph::os::Transaction& txn,
{
const ceph_osd_op& op = osd_op.op;
if (op.extent.length != osd_op.indata.length()) {
- throw crimson::osd::invalid_argument();
+ return crimson::ct_error::invarg::make();
+ }
+ if (!is_offset_and_length_valid(op.extent.offset, op.extent.length)) {
+ return crimson::ct_error::file_too_large::make();
}
const bool existing = maybe_create_new_object(os, txn, delta_stats);
// TODO: switch the entire write family to errorator.
using write_ertr = crimson::errorator<
- crimson::ct_error::file_too_large>;
+ crimson::ct_error::file_too_large,
+ crimson::ct_error::invarg>;
using write_iertr =
::crimson::interruptible::interruptible_errorator<
::crimson::osd::IOInterruptCondition,
interruptible_future<> remove(
ObjectState& os,
ceph::os::Transaction& txn);
- interruptible_future<> write(
+ write_iertr::future<> write(
ObjectState& os,
const OSDOp& osd_op,
ceph::os::Transaction& trans,
ceph::os::Transaction& trans,
osd_op_params_t& osd_op_params,
object_stat_sum_t& delta_stats);
- interruptible_future<> writefull(
+ write_iertr::future<> writefull(
ObjectState& os,
const OSDOp& osd_op,
ceph::os::Transaction& trans,