From aab685bea9bee8710e8e88c8e86d436016484abf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 7 Aug 2008 11:27:36 -0700 Subject: [PATCH] osd: observe snapset.head_exists on read --- src/osd/ReplicatedPG.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index cc07f91ae1680..5f3e7d57e2167 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -472,9 +472,18 @@ bool ReplicatedPG::pick_read_snap(pobject_t& poid) // head? if (want > snapset.seq) { - dout(10) << "pick_read_snap " << head << " want " << want << " > snapset seq " << snapset.seq << " -- HIT" << dendl; - poid = head; - return true; + if (snapset.head_exists) { + dout(10) << "pick_read_snap " << head + << " want " << want << " > snapset seq " << snapset.seq + << " -- HIT" << dendl; + poid = head; + return true; + } else { + dout(10) << "pick_read_snap " << head + << " want " << want << " > snapset seq " << snapset.seq + << " but head_exists = false -- DNE" << dendl; + return false; + } } // which clone would it be? -- 2.39.5