]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Fix logic in OSDMap::containing_subtree_is_down()
authorDavid Zafman <david.zafman@inktank.com>
Thu, 25 Apr 2013 23:04:00 +0000 (16:04 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Fri, 26 Apr 2013 17:24:43 +0000 (10:24 -0700)
Check for up OSDs as we walk up the crushmap hierarchy

fixes: #4822

Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/OSDMap.cc

index 28cc6a73f64c451ea72d37d40a897e0ba10c58ed..8e0474eb7818f0e8b5b135026d4dd2654a12b044 100644 (file)
@@ -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;