From d8bf378314b012724116e01d23acac09d8bd47ca Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Thu, 12 Mar 2015 16:15:45 +0800 Subject: [PATCH] osd/ReplicatePG: correctly checking if an object is in hit set For the write case when the oid.snap is CEPH_NOSNAP, the obc is created in find_object_context, and missing_oid is setting to a NULL object. Checking if the missing_oid is in the hit set is not the correct way since it's NULL. Instead, we should check the obc->obs.oi.soid. Signed-off-by: Zhiqiang Wang --- src/osd/ReplicatedPG.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 3b6184118d2d..28db26b15f6e 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1607,8 +1607,13 @@ void ReplicatedPG::do_op(OpRequestRef& op) bool in_hit_set = false; if (hit_set) { - if (missing_oid != hobject_t() && hit_set->contains(missing_oid)) - in_hit_set = true; + if (obc.get()) { + if (obc->obs.oi.soid != hobject_t() && hit_set->contains(obc->obs.oi.soid)) + in_hit_set = true; + } else { + if (missing_oid != hobject_t() && hit_set->contains(missing_oid)) + in_hit_set = true; + } hit_set->insert(oid); if (hit_set->is_full() || hit_set_start_stamp + pool.info.hit_set_period <= m->get_recv_stamp()) { -- 2.47.3