]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ObjectCacher: On RetryRead, ensure "hole" value is used
authorChristopher Hoffman <choffman@redhat.com>
Wed, 28 Aug 2024 22:07:28 +0000 (22:07 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:34 +0000 (13:59 +0000)
On C_RetryRead, ensure "hole" value instead of pointer
to a pointer is used to allow populating vector of holes.

Fixes: https://tracker.ceph.com/issues/67659
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/osdc/ObjectCacher.cc

index 26340b056f275810231743b161a36afad7c3fb34..c10a2ffd1d62be15e76b73b40685cc750973fc63 100644 (file)
@@ -88,16 +88,16 @@ class ObjectCacher::C_RetryRead : public Context {
   ObjectSet *oset;
   Context *onfinish;
   ZTracer::Trace trace;
-  std::vector<ObjHole> *holes;
+  std::vector<ObjHole> holes;
 public:
   C_RetryRead(ObjectCacher *_oc, OSDRead *r, ObjectSet *os, Context *c,
              const ZTracer::Trace &trace,
-              std::vector<ObjHole> *holes)
-    : oc(_oc), rd(r), oset(os), onfinish(c), trace(trace), holes(holes) {
+              std::vector<ObjHole> h)
+    : oc(_oc), rd(r), oset(os), onfinish(c), trace(trace), holes(h) {
   }
   void finish(int r) override {
     if (r >= 0) {
-      r = oc->_readx(rd, oset, onfinish, false, &trace, holes);
+      r = oc->_readx(rd, oset, onfinish, false, &trace, &holes);
     }
 
     if (r == 0) {
@@ -1479,7 +1479,7 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
          ldout(cct, 10) << "readx  waiting on tid " << o->last_write_tid
                         << " on " << *o << dendl;
          o->waitfor_commit[o->last_write_tid].push_back(
-           new C_RetryRead(this,rd, oset, onfinish, *trace, holes));
+           new C_RetryRead(this,rd, oset, onfinish, *trace, *holes));
          // FIXME: perfcounter!
          return 0;
        }
@@ -1537,7 +1537,7 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
                           << (std::max(rx_bytes, max_size) - max_size)
                           << " read bytes" << dendl;
            waitfor_read.push_back(new C_RetryRead(this, rd, oset, onfinish,
-                                                  *trace, holes));
+                                                  *trace, *holes));
          }
 
          bh_remove(o, bh_it->second);
@@ -1556,7 +1556,7 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
        ldout(cct, 10) << "readx missed, waiting on " << *last->second
          << " off " << last->first << dendl;
        last->second->waitfor_read[last->first].push_back(
-         new C_RetryRead(this, rd, oset, onfinish, *trace, holes) );
+         new C_RetryRead(this, rd, oset, onfinish, *trace, *holes) );
 
       }
 
@@ -1569,7 +1569,7 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
          ldout(cct, 10) << "readx missed, waiting on " << *bh_it->second
                         << " off " << bh_it->first << dendl;
          bh_it->second->waitfor_read[bh_it->first].push_back(
-           new C_RetryRead(this, rd, oset, onfinish, *trace, holes) );
+           new C_RetryRead(this, rd, oset, onfinish, *trace, *holes) );
        }
        bytes_not_in_cache += bh_it->second->length();
        success = false;