From: Zhiqiang Wang Date: Fri, 20 Mar 2015 02:45:34 +0000 (+0800) Subject: osd/ReplicatedPG: correct the checking if the promoting object is in other X-Git-Tag: v9.0.1~158^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b5c745057cc4d9573f9ff81879322b606c749520;p=ceph.git osd/ReplicatedPG: correct the checking if the promoting object is in other hit sets missing_oid could be a NULL object while obc is not. Should check obc->obs.oi.soid first, and then missing_oid. Signed-off-by: Zhiqiang Wang --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 3d8ed84b4b95..5482f6787dac 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1945,10 +1945,17 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op, map::iterator itor; bool in_other_hit_sets = false; for (itor = agent_state->hit_set_map.begin(); itor != agent_state->hit_set_map.end(); ++itor) { - if (itor->second->contains(missing_oid)) { - in_other_hit_sets = true; - break; - } + if (obc.get()) { + if (obc->obs.oi.soid != hobject_t() && itor->second->contains(obc->obs.oi.soid)) { + in_other_hit_sets = true; + break; + } + } else { + if (missing_oid != hobject_t() && itor->second->contains(missing_oid)) { + in_other_hit_sets = true; + break; + } + } } if (in_other_hit_sets) { promote_object(obc, missing_oid, oloc, promote_op);