diff options
author | David Zafman <david.zafman@inktank.com> | 2013-04-25 16:04:00 -0700 |
---|---|---|
committer | David Zafman <david.zafman@inktank.com> | 2013-04-26 10:24:43 -0700 |
commit | e3b602adf7527101e4fd198263c8f7c1d4b5d194 (patch) | |
tree | dd34fcd55954056528fc6c29877aadaa38c937bb | |
parent | f4804849b7644f2c1dfd92404682f510a88e9a23 (diff) | |
download | ceph-e3b602adf7527101e4fd198263c8f7c1d4b5d194.tar.gz |
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 <david.zafman@inktank.com>
-rw-r--r-- | src/osd/OSDMap.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 28cc6a73f64..8e0474eb781 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; |