]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
neorados: Fix logic error in exerciser
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 15 Sep 2022 18:46:47 +0000 (14:46 -0400)
committerAdam Emerson <aemerson@redhat.com>
Wed, 6 Dec 2023 20:39:35 +0000 (15:39 -0500)
Use `min` rather than `max` when deciding how much we need to read in
`read()`.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/tools/neorados.cc

index c59cf739fafb51aad5fe428b2874b77a03632733..be5dd1a2541dcae2d27815348e01446721ab81c6 100644 (file)
@@ -204,7 +204,7 @@ void read(R::RADOS& r, const std::vector<std::string>& p, s::yield_context y)
 
   std::size_t off = 0;
   ceph::buffer::list bl;
-  while (auto toread = std::max(len - off, io_size)) {
+  while (auto toread = std::min(len - off, io_size)) {
     R::ReadOp op;
     op.read(off, toread, &bl);
     r.execute(obj, pool, std::move(op), nullptr, y[ec]);