]> git.apps.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>
Thu, 14 Sep 2023 21:03:16 +0000 (17:03 -0400)
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 a8604f0effc76c818d4701389c4d57550ad6236a..c89fb49c9c50fc03ce06076301daaebc1f4e710a 100644 (file)
@@ -205,7 +205,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]);