From 1d0c91d585409c6df636d7d70582167d329f403a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Jul 2010 14:58:43 -0700 Subject: [PATCH] osd: populate in-memory snapset context with just-pulled SnapSet This can come from the SNAPDIR or NOSNAP (head) object. Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5ba4f6a1b94b0..2c1921ceace09 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3445,10 +3445,13 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) bufferlist data; op->claim_data(data); - // we need this later, and it gets clobbered by t.setattrs() + // we need these later, and they get clobbered by t.setattrs() bufferlist oibl; if (op->attrset.count(OI_ATTR)) oibl.push_back(op->attrset[OI_ATTR]); + bufferlist ssbl; + if (op->attrset.count(SS_ATTR)) + ssbl.push_back(op->attrset[SS_ATTR]); // determine data/clone subsets data_subset = op->data_subset; @@ -3632,6 +3635,13 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) obc->obs.exists = true; obc->obs.oi.decode(oibl); + // suck in snapset context? + SnapSetContext *ssc = obc->obs.ssc; + if (ssbl.length()) { + bufferlist::iterator sp = ssbl.begin(); + ssc->snapset.decode(sp); + } + onreadable = new C_OSD_WrotePushedObject(this, t, obc); onreadable_sync = new C_OSD_OndiskWriteUnlock(obc); } else { -- 2.39.5