From c83acfa360c0b76c10de94d038c3a211c903607c Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 28 Mar 2024 13:28:11 +0000 Subject: [PATCH] test/ceph_test_rados: fix seeking over virtual, in-memory objects `ceph_test_rados` maintains a database of in-memory pseudo-objects that are used to dynamically 1) generate content for writing into RADOS objects and 2) regenerate it later when comparing buffers of completed RADOS reads. Content of these objects is ephemeral; to preserve space we store only starting parameters for a pseudo-random number generator. However, this memory optimization requires strict management of calls to the PRGN. Unfortunately, adding partial reads support has unveiled a bug in this aspect: `ObjectDesc::iterator::seek()` was missing a call to underlying `RandGenerator::iterator_impl::seek()`, resulting in mismatches on read buffer validation. Signed-off-by: Radoslaw Zarzynski --- src/test/osd/Object.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/osd/Object.h b/src/test/osd/Object.h index 29338e814e1fc..05d32a6f031f2 100644 --- a/src/test/osd/Object.h +++ b/src/test/osd/Object.h @@ -431,6 +431,9 @@ public: } } ceph_assert(pos == _pos); + if (current != layers.end()) { + current->iter.seek(pos); + } } // grab the bytes in the range of [pos, pos+s), and advance @c pos -- 2.39.5