From d50254be6439bb3ae8142fd06334c7d1d072c6af Mon Sep 17 00:00:00 2001 From: Christopher Hoffman Date: Wed, 28 Aug 2024 22:07:28 +0000 Subject: [PATCH] ObjectCacher: On RetryRead, ensure "hole" value is used 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 --- src/osdc/ObjectCacher.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index ca5622ac8fc..6c6d5a51314 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -88,16 +88,16 @@ class ObjectCacher::C_RetryRead : public Context { ObjectSet *oset; Context *onfinish; ZTracer::Trace trace; - std::vector *holes; + std::vector holes; public: C_RetryRead(ObjectCacher *_oc, OSDRead *r, ObjectSet *os, Context *c, const ZTracer::Trace &trace, - std::vector *holes) - : oc(_oc), rd(r), oset(os), onfinish(c), trace(trace), holes(holes) { + std::vector 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; -- 2.39.5