From 7719091aef5671bc52739fd01b07f501046fb52d Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Wed, 3 Jul 2024 15:55:36 +0200 Subject: [PATCH] test/allocsim: trim bufferlist before sending Signed-off-by: Pere Diaz Bou --- src/test/objectstore/allocsim/ops_replayer.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/test/objectstore/allocsim/ops_replayer.cc b/src/test/objectstore/allocsim/ops_replayer.cc index 18a1739e42f..d9263076345 100644 --- a/src/test/objectstore/allocsim/ops_replayer.cc +++ b/src/test/objectstore/allocsim/ops_replayer.cc @@ -1,8 +1,6 @@ #include #include #include -#include -#include #include #include #include @@ -15,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -219,14 +216,18 @@ void worker_thread_entry(uint64_t id, uint64_t nworker_threads, vector &ops, op.completion = librados::Rados::aio_create_completion(static_cast(&op), completion_cb); switch (op.type) { case Write: { - int ret = io->aio_write(*op.object, op.completion, bl, op.length, op.offset); + bufferlist trimmed; + trimmed.substr_of(bl, 0, op.length); + int ret = io->aio_write(*op.object, op.completion, trimmed, op.length, op.offset); if (ret != 0) { cout << fmt::format("Error writing ecode={}", ret) << endl;; } break; } case WriteFull: { - int ret = io->aio_write_full(*op.object, op.completion, bl); + bufferlist trimmed; + trimmed.substr_of(bl, 0, op.length); + int ret = io->aio_write_full(*op.object, op.completion, trimmed); if (ret != 0) { cout << fmt::format("Error writing full ecode={}", ret) << endl;; } -- 2.47.3