Skip to content

Commit f4e1653

Browse files
committed
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 <[email protected]>
1 parent 163a28a commit f4e1653

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/common/io_exerciser/RadosIo.cc

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ void RadosIo::applyIoOp(IoOp &op)
154154
version_t ver,
155155
bufferlist bl) {
156156
ceph_assert(ec == boost::system::errc::success);
157-
db->validate(op_info->bl1, op_info->offset1, op_info->length1);
157+
ceph_assert(db->validate(op_info->bl1,
158+
op_info->offset1,
159+
op_info->length1));
158160
finish_io();
159161
};
160162
librados::async_operate(asio, io, oid,
@@ -181,8 +183,12 @@ void RadosIo::applyIoOp(IoOp &op)
181183
version_t ver,
182184
bufferlist bl) {
183185
ceph_assert(ec == boost::system::errc::success);
184-
db->validate(op_info->bl1, op_info->offset1, op_info->length1);
185-
db->validate(op_info->bl2, op_info->offset2, op_info->length2);
186+
ceph_assert(db->validate(op_info->bl1,
187+
op_info->offset1,
188+
op_info->length1));
189+
ceph_assert(db->validate(op_info->bl2,
190+
op_info->offset2,
191+
op_info->length2));
186192
finish_io();
187193
};
188194
librados::async_operate(asio, io, oid,
@@ -210,9 +216,15 @@ void RadosIo::applyIoOp(IoOp &op)
210216
version_t ver,
211217
bufferlist bl) {
212218
ceph_assert(ec == boost::system::errc::success);
213-
db->validate(op_info->bl1, op_info->offset1, op_info->length1);
214-
db->validate(op_info->bl2, op_info->offset2, op_info->length2);
215-
db->validate(op_info->bl3, op_info->offset3, op_info->length3);
219+
ceph_assert(db->validate(op_info->bl1,
220+
op_info->offset1,
221+
op_info->length1));
222+
ceph_assert(db->validate(op_info->bl2,
223+
op_info->offset2,
224+
op_info->length2));
225+
ceph_assert(db->validate(op_info->bl3,
226+
op_info->offset3,
227+
op_info->length3));
216228
finish_io();
217229
};
218230
librados::async_operate(asio, io, oid,

0 commit comments

Comments
 (0)