From: David Zafman Date: Thu, 25 Apr 2013 23:04:00 +0000 (-0700) Subject: osd: Fix logic in OSDMap::containing_subtree_is_down() X-Git-Tag: v0.61~85^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e3b602adf7527101e4fd198263c8f7c1d4b5d194;p=ceph.git osd: Fix logic in OSDMap::containing_subtree_is_down() Check for up OSDs as we walk up the crushmap hierarchy fixes: #4822 Signed-off-by: David Zafman --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 28cc6a73f64c..8e0474eb7818 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -205,14 +205,8 @@ bool OSDMap::containing_subtree_is_down(CephContext *cct, int id, int subtree_ty down_cache = &local_down_cache; } - if (!subtree_is_down(id, down_cache)) { - ldout(cct, 30) << "containing_subtree_is_down(" << id << ") = false" << dendl; - return false; - } - int current = id; while (true) { - // invariant: current subtree is known to be down. int type; if (current >= 0) { type = 0; @@ -221,6 +215,11 @@ bool OSDMap::containing_subtree_is_down(CephContext *cct, int id, int subtree_ty } assert(type >= 0); + if (!subtree_is_down(current, down_cache)) { + ldout(cct, 30) << "containing_subtree_is_down(" << id << ") = false" << dendl; + return false; + } + // is this a big enough subtree to be done? if (type >= subtree_type) { ldout(cct, 30) << "containing_subtree_is_down(" << id << ") = true ... " << type << " >= " << subtree_type << dendl;