From: Pere Diaz Bou Date: Wed, 3 Jul 2024 13:55:36 +0000 (+0200) Subject: test/allocsim: trim bufferlist before sending X-Git-Tag: v20.0.0~1596^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F58395%2Fhead;p=ceph.git test/allocsim: trim bufferlist before sending Signed-off-by: Pere Diaz Bou --- diff --git a/src/test/objectstore/allocsim/ops_replayer.cc b/src/test/objectstore/allocsim/ops_replayer.cc index 18a1739e42f2..d92630763454 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;; }