]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make get_dirfrags_under behave when dirfragtree is not coherent with dirfrag set
authorSage Weil <sage@newdream.net>
Tue, 4 Jan 2011 22:35:41 +0000 (14:35 -0800)
committerSage Weil <sage@newdream.net>
Tue, 4 Jan 2011 23:27:16 +0000 (15:27 -0800)
This is (currently) the case during replay/resolve, although it's not
clear that it should be.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/CInode.cc

index 593ef40fb273f22b852e82741f2d312d95f8ddc6..1124d2f3a1c755187257c2e082fdb1c2dedb25fa 100644 (file)
@@ -439,9 +439,16 @@ frag_t CInode::pick_dirfrag(const string& dn)
 
 bool CInode::get_dirfrags_under(frag_t fg, list<CDir*>& ls)
 {
+  bool all = true;
+  for (map<frag_t,CDir*>::iterator p = dirfrags.begin(); p != dirfrags.end(); ++p) {
+    if (fg.contains(p->first))
+      ls.push_back(p->second);
+    else
+      all = false;
+  }
+  /*
   list<frag_t> fglist;
   dirfragtree.get_leaves_under(fg, fglist);
-  bool all = true;
   for (list<frag_t>::iterator p = fglist.begin();
        p != fglist.end();
        ++p) 
@@ -449,6 +456,7 @@ bool CInode::get_dirfrags_under(frag_t fg, list<CDir*>& ls)
       ls.push_back(dirfrags[*p]);
     else 
       all = false;
+  */
   return all;
 }