From f4e165305f81166ee2a650994ffe0313efe75ab8 Mon Sep 17 00:00:00 2001 From: JonBailey1993 Date: Mon, 7 Oct 2024 10:39:24 +0100 Subject: [PATCH] common/io_exerciser: Add assertion on failure of IO validation Assert on failure of IO validation so it's clearer and error has occurred and state of the system will not move beyond the error point. Signed-off-by: Jon Bailey --- src/common/io_exerciser/RadosIo.cc | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/common/io_exerciser/RadosIo.cc b/src/common/io_exerciser/RadosIo.cc index a28a1e2f488b4..44b82260263a2 100644 --- a/src/common/io_exerciser/RadosIo.cc +++ b/src/common/io_exerciser/RadosIo.cc @@ -154,7 +154,9 @@ void RadosIo::applyIoOp(IoOp &op) version_t ver, bufferlist bl) { ceph_assert(ec == boost::system::errc::success); - db->validate(op_info->bl1, op_info->offset1, op_info->length1); + ceph_assert(db->validate(op_info->bl1, + op_info->offset1, + op_info->length1)); finish_io(); }; librados::async_operate(asio, io, oid, @@ -181,8 +183,12 @@ void RadosIo::applyIoOp(IoOp &op) version_t ver, bufferlist bl) { ceph_assert(ec == boost::system::errc::success); - db->validate(op_info->bl1, op_info->offset1, op_info->length1); - db->validate(op_info->bl2, op_info->offset2, op_info->length2); + ceph_assert(db->validate(op_info->bl1, + op_info->offset1, + op_info->length1)); + ceph_assert(db->validate(op_info->bl2, + op_info->offset2, + op_info->length2)); finish_io(); }; librados::async_operate(asio, io, oid, @@ -210,9 +216,15 @@ void RadosIo::applyIoOp(IoOp &op) version_t ver, bufferlist bl) { ceph_assert(ec == boost::system::errc::success); - db->validate(op_info->bl1, op_info->offset1, op_info->length1); - db->validate(op_info->bl2, op_info->offset2, op_info->length2); - db->validate(op_info->bl3, op_info->offset3, op_info->length3); + ceph_assert(db->validate(op_info->bl1, + op_info->offset1, + op_info->length1)); + ceph_assert(db->validate(op_info->bl2, + op_info->offset2, + op_info->length2)); + ceph_assert(db->validate(op_info->bl3, + op_info->offset3, + op_info->length3)); finish_io(); }; librados::async_operate(asio, io, oid, -- 2.39.5