]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fragtree_t: fix get_leaves_under()
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 23 Sep 2013 07:28:52 +0000 (15:28 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Sat, 5 Oct 2013 03:31:12 +0000 (11:31 +0800)
If fragtree is (*^1, 1*^1) and we want leaves under frag 000*.
get_leaves_under() return frag 0*, frag 10* and frag 11*. This is
obviously wrong.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/include/frag.h

index 715eb09828391c7bf03f0e6dbefc66d3892bbbc6..fbe5b43f8cbe010e7475ca610d6ac8927fb68d32 100644 (file)
@@ -285,7 +285,7 @@ public:
    */
   void get_leaves_under(frag_t x, std::list<frag_t>& ls) const {
     std::list<frag_t> q;
-    q.push_back(get_branch(x));
+    q.push_back(get_branch_or_leaf(x));
     while (!q.empty()) {
       frag_t t = q.front();
       q.pop_front();